Compare commits
2 Commits
abadbf2b71
...
e21d20c569
Author | SHA1 | Date | |
---|---|---|---|
e21d20c569 | |||
6e7eac63a7 |
@ -1,5 +1,7 @@
|
|||||||
<h1>DER BIMMLER</h2>
|
<h1>DER BIMMLER</h2>
|
||||||
<?php
|
<?php
|
||||||
|
$time_start = microtime(true);
|
||||||
|
|
||||||
function move_number_closer(&$headn, &$tailn) {
|
function move_number_closer(&$headn, &$tailn) {
|
||||||
$distance = $headn - $tailn;
|
$distance = $headn - $tailn;
|
||||||
if (abs($distance) > 1) {
|
if (abs($distance) > 1) {
|
||||||
@ -100,6 +102,9 @@ for ($i = 0; $i < count($head_movements); $i++) {
|
|||||||
/* display($current_positions[0], $current_positions[$last_tail]); */
|
/* display($current_positions[0], $current_positions[$last_tail]); */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print_r($visited_positions);
|
/* print_r($visited_positions); */
|
||||||
print("Total number of positions=".array_sum($visited_positions));
|
print("Total number of positions=".array_sum($visited_positions));
|
||||||
print("Number of unique visited positions=".count($visited_positions));
|
print("Number of unique visited positions=".count($visited_positions));
|
||||||
|
|
||||||
|
// Anywhere else in the script
|
||||||
|
echo 'Total execution time: ' . (microtime(true) - $time_start);
|
||||||
|
@ -53,3 +53,5 @@ Also, check out the repositories of my friends who do stuff in go, Visual Basic,
|
|||||||
|
|
||||||
Lines of code are without blank lines and comments
|
Lines of code are without blank lines and comments
|
||||||
|
|
||||||
|
## Update
|
||||||
|
Unfortunately, I had to stop because I did not have enough time to keep up. Maybe next year!
|
||||||
|
Loading…
Reference in New Issue
Block a user