pageTitle = 'Blogpost: ' . $model->Title . ' - ' . Yii::app()->name; if ($currproblemID < 0) { $this->breadcrumbs = array( 'Blog' => ['/blog'], $model->Title, ); } else { $this->breadcrumbs = array( 'Blog' => ['/blog'], $model->Title => [$model->getLink()], 'Problem_' . str_pad($problems[$currproblemID]->Problemnumber, 3, '0', STR_PAD_LEFT), ); } array_push($this->css_files, "/css/blogpost_ProjectEulerBefunge_style.css"); ?>
Fork me on GitHub

Title ?>

A lot of you probably know Project Euler.
For those who don't here a short explanation: Project Euler is a collection of mathematical/programming problems. Most problems consist of finding a single number and are solved by writing a program in the programming language of your choice.

Most people solve these by using normal languages like C, Java, Phyton, Haskell etc. But you can also go a step further and try solving it with a little bit more exotic languages.

So here are my solutions written in Befunge

Note:
Similar to most Befunge content on this site I only used the Befunge-93 instruction-set but ignored the 80x25 size restriction. (Even so most programs here don't get this big.)

' . "\r\n"; echo '\r\n"; echo '\r\n"; echo '\r\n"; if ($problem->isBefunge93()) echo '\r\n"; else echo '\r\n"; echo '\r\n"; echo "\r\n"; } ?>
Number Title Time Size Solution (hover to reveal)
' . $problem->Problemnumber . "' . $problem->Problemtitle . "
' . MsHelper::formatMilliseconds($problem->SolutionTime) . "
' . $problem->SolutionWidth . 'x' . $problem->SolutionHeight . '
Bef-93
' . "
' . $problem->SolutionWidth . 'x' . $problem->SolutionHeight . '
Bef-98
' . "
' . number_format($problem->SolutionValue, 0, null, ',') . "
= 0) { echo 'Fork me on GitHub'; echo "

$model->Title

"; echo ParsedownHelper::parse($currproblem->generateMarkdown()); } else { echo "

Problems:

"; } ?> str_pad($problems[$i]->Problemnumber, 3, '0', STR_PAD_LEFT), 'url' => $problems[$i]->getBlogLink(), 'disabled' => false, 'active' => $currproblemID == $i, ]); else array_push($pagination, [ 'label' => str_pad($i+1, 3, '0', STR_PAD_LEFT), 'url' => '#', 'disabled' => true, 'active' => false, ]); if ((($i+1) % 20 == 0)) { echo TbHtml::pagination($pagination, ['align' => TbHtml::PAGINATION_ALIGN_CENTER]); $pagination = array(); } } echo TbHtml::pagination($pagination, ['align' => TbHtml::PAGINATION_ALIGN_CENTER]); ?>
Title; ?>
getDateTime()->format('d.m.Y'); ?>
widget( 'ext.YiiDisqusWidget.YiiDisqusWidget', [ 'shortname' => 'mikescher-de', 'identifier' => 'blog/view/' + $model->ID, 'title' => $model->Title, 'url' => $model->getAbsoluteLink(), 'category_id' => '3253401', // = blog/view ] ); ?>