hey all. im not much of a programmer, but from the help ive gotten from you guys and from the manual and from some trial and error, ive gotten like 1/3 of what i want to do done. below is the whole script (minus the parts i dont know how to do). im asking if anybody wants to contribute a line or two to the parts i dont know, or give a suggestion on how i can figure out for myself the parts i dont know i would appreciate it. the script follows:
<?
// Random Journey Creator - An Interactive Art Project
// $dist comes from a form that ask for the user to input a distance to travel in steps.
$distance = $dist;
// decide how many turns to make
function make_seed() {
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
srand(make_seed());
$turns = rand(0,21);
// assign right turns to even numbers, left turns to odd numbers
$odd = array();
$even = array();
$current_is_odd = $turns % 2;
for ($i = 0; $i <= $turns; $i++) {
if ($current_is_odd) $odd[] = $i;
else $even[] = $i;
$current_is_odd = !$current_is_odd;
}
function create_distance() {
//i want to devide the disance in $distance into $turns number
//of pieces of random length that add upto $distance.
}
function create_turns() {
//use the above even and odd number arrays to assign
//each even num a right and each odd num a left.
//then randomly choose right or left turn to make for each value of $turn.
}
function create_journey() {
//this should make create_distance() and create_turns()
//make an alternating list of distace and turn direction
//untill all turns ($turns) are made and the full distance
//($distance) has been reached.
}
?>
thank you everybody and anybody who feels like helping. this is part of a project im doing for a class at school. im a art student by day and computer geek by night 🙂
if you want to see what insipired the idea of this, check out
Hamish Fulton's work... very cool 🙂