1
0

bef runner bug fixes

This commit is contained in:
2018-01-03 00:55:15 +01:00
parent 4f7795c70b
commit 17a81b9fea
6 changed files with 25 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ $editable = $PARAM_BEFUNGE93RUNNER['editable'];
function fmtBef($str) {
$str = htmlspecialchars($str);
$str = str_replace("\r\n", "\n", $str);
$str = str_replace("\r", "", $str);
$str = join("\n", array_map(function($p){return rtrim($p);}, explode("\n", $str)));
$str = str_replace(' ', ' ', $str);
$str = nl2br($str);

View File

@@ -53,7 +53,7 @@ $max = ceil($max / 20) * 20;
'code' => file_get_contents($problem['file_code']),
'url' => $problem['url_raw'],
'interactive' => !$problem['abbreviated'],
'speed' => null,
'speed' => $problem['steps'] < 500000 ? 2 : 3,
'editable' => false,
];
echo require (__DIR__ . '/../fragments/befunge93_runner.php');
@@ -73,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>(=' . (($problem['time']===0) ? '?' : number_format(($problem['steps']/$problem['time'])/1000, 2, '.', '')) . ' MHz)</i>'; ?></td>
<td><?php echo formatMilliseconds($problem['time']) . ' <i>(' . (($problem['time']===0) ? '?' : number_format(($problem['steps']/$problem['time'])/1000, 2, '.', '')) . ' MHz)</i>'; ?></td>
</tr>
<tr>
<td><b>Program size:</b></td>