Skip to content

Instantly share code, notes, and snippets.

@s3gfau1t
Forked from codenamegary/gist:7013108
Last active December 25, 2015 17:29
Show Gist options
  • Save s3gfau1t/7013150 to your computer and use it in GitHub Desktop.
Save s3gfau1t/7013150 to your computer and use it in GitHub Desktop.
<?php
$velocities = array("turtle", "donkey", "rabbit");
$players = array(
'1' => array(
'name' => 'Foo',
'velocity' => $velocities[rand(0,2)]),
'2' => array(
'name' => 'Bar',
'velocity' => $velocities[rand(0,2)]),
);
echo "(player 1) {$players['1']['name']} :: will go as fast as a {$players['1']['velocity']}\r\n";
$actions = array(
array('action' => 'stumbles', 'distance' => 0 ),
array('action' => 'leaps', 'distance' => rand(1,3) ),
array('action' => 'strides', 'distance' => rand(1,3) ),
array('action' => 'sprints', 'distance' => rand(1,5) ),
array('action' => 'falls', 'distance' => 0 ),
array('action' => 'shuffles', 'distance' => rand(1,2) ),
array('action' => 'walks', 'distance' => rand(0,2) ),
array('action' => 'runs', 'distance' => rand(0,2) ),
array('action' => 'skips', 'distance' => rand(0,2) ),
array('action' => 'gasps', 'distance' => 0 ),
array('action' => 'cavorts', 'distance' => rand(1,3) ),
array('action' => 'dances', 'distance' => rand(1,3) ),
array('action' => 'pauses', 'distance' => 0 ),
array('action' => 'zips', 'distance' => rand(1,5) ),
array('action' => 'zooms', 'distance' => rand(1,5) ),
array('action' => 'collapses', 'distance' => 0 ),
array('action' => 'faceplants', 'distance' => 0 ),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment