<?php
class Bus {
static $speed = 0.0;
static $bomb_is_armed = false;
static $bomb_is_exploded = false;
public static function drive() {
while(!self::$bomb_is_exploded) {
if(self::$speed < 50.0) {
self::$speed += rand(10, 20);
}
elseif(!self::$bomb_is_armed) {
self::$bomb_is_armed = true;
}
elseif(self::$bomb_is_armed) {
self::$speed -= rand(1, 2);
if(self::$speed < 50.0) {
self::$bomb_is_exploded = true;
}
}
}
echo 'Sorry, Denis Hopper has WON!';
}
}
Bus::drive();
?>
class Bus {
static $speed = 0.0;
static $bomb_is_armed = false;
static $bomb_is_exploded = false;
public static function drive() {
while(!self::$bomb_is_exploded) {
if(self::$speed < 50.0) {
self::$speed += rand(10, 20);
}
elseif(!self::$bomb_is_armed) {
self::$bomb_is_armed = true;
}
elseif(self::$bomb_is_armed) {
self::$speed -= rand(1, 2);
if(self::$speed < 50.0) {
self::$bomb_is_exploded = true;
}
}
}
echo 'Sorry, Denis Hopper has WON!';
}
}
Bus::drive();
?>