----------------------------------- a random person Fri Dec 02, 2005 8:42 am Football by A.R.P. ----------------------------------- hi there this is a football simulater. the story is the team is down by five late in the game, there is only time for about 10 more plays, they MUST score a TD to win the game. var receiver, yardsGained, down, yardsLeft, yardsToGo, plays : int var wrName : string plays := 0 down := 1 yardsToGo := 10 yardsLeft := 50 loop randint (receiver, 1, 4) if receiver = 1 then wrName := "wide receiver" elsif receiver = 2 then wrName := "slot receiver" elsif receiver = 3 then wrName := "tight end" elsif receiver = 4 then wrName := "halfback" end if if receiver = 4 then randint (yardsGained, -3, 6) else randint (yardsGained, 3, 10) end if if yardsGained < 0 then put "the qaurterback is sacked for a loss of ", yardsGained plays := plays + 1 down := down + 1 yardsToGo := yardsToGo - yardsGained yardsLeft := yardsLeft - yardsGained put "it is ", yardsToGo, " and ", down, " on the opponent's ", yardsLeft else put "the quarterback passes it to the ", wrName, " for a gain of ", yardsGained plays := plays + 1 down := down + 1 yardsToGo := yardsToGo - yardsGained yardsLeft := yardsLeft - yardsGained put "it is ", yardsToGo, " and ", down, " on the opponent's ", yardsLeft end if if yardsToGo