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"); ?>
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.)
Number | Title | Time | Size | Solution (hover to reveal) | ' . $problem->Problemnumber . " | \r\n"; echo '' . $problem->Problemtitle . " | \r\n"; echo '' . MsHelper::formatMilliseconds($problem->SolutionTime) . " | \r\n";
if ($problem->isBefunge93())
echo '' . $problem->SolutionWidth . 'x' . $problem->SolutionHeight . ' Bef-93 ' . " | \r\n";
else
echo '' . $problem->SolutionWidth . 'x' . $problem->SolutionHeight . ' Bef-98 ' . " | \r\n";
echo '' . number_format($problem->SolutionValue, 0, null, ',') . " | \r\n"; echo "\r\n"; } ?>
---|