1
0

bef93-runner blogpost

This commit is contained in:
2018-01-03 00:08:42 +01:00
parent a3c191a837
commit 4f7795c70b
11 changed files with 324 additions and 97 deletions

View File

@@ -47,12 +47,18 @@ $max = ceil($max / 20) * 20;
<b>Solution:</b>
<?php
global $PARAM_CODE;
global $PARAM_URL;
$PARAM_CODE = file_get_contents($problem['file_code']);
$PARAM_URL = $problem['url_raw'];
$PARAM_INTERACTIVE = !$problem['abbreviated'];
global $PARAM_BEFUNGE93RUNNER;
$PARAM_BEFUNGE93RUNNER =
[
'code' => file_get_contents($problem['file_code']),
'url' => $problem['url_raw'],
'interactive' => !$problem['abbreviated'],
'speed' => null,
'editable' => false,
];
echo require (__DIR__ . '/../fragments/befunge93_runner.php');
if ($problem['abbreviated']) echo '<i>This program is too big to display/execute here, click [download] to get the full program. </i><br/>';
?>
<br/>
@@ -67,7 +73,7 @@ $max = ceil($max / 20) * 20;
</tr>
<tr>
<td><b>Execution time</b> (<a href="/programs/view/BefunGen">BefunExec</a>):</td>
<td><?php echo $problem['time'] . ' ms <i>(=' . number_format(($problem['steps']/$problem['time'])/1000, 2, '.', '') . ' MHz)</i>'; ?></td>
<td><?php echo $problem['time'] . ' ms <i>(=' . (($problem['time']===0) ? '?' : number_format(($problem['steps']/$problem['time'])/1000, 2, '.', '')) . ' MHz)</i>'; ?></td>
</tr>
<tr>
<td><b>Program size:</b></td>