Game designers are designing characters for a new online game they hope is going to go viral - Jeep Sheep!
3 sheep race their jeeps 1000m. The first jeep to reach the finish line is the winner. Before the race starts, the player predicts which sheep will win. If the prediction is correct, the player wins!
They need a coder to code the game logic of the game. Harold, the initial designer has already made a start:
#create an empty array to store the three racers' names
#ask the player for the name of each racer and append into the array
#now set up another array to store the distance travelled for each racer, starting at 0:
#now get the prediction from the player:
#Now validate the user input. The user must enter only one of the available names
#start of game logic. Play the game while no racer has reached 1000
#generate a random number between 0 and 100 for each racer and update each racer's distance (hint: use a for loop)
#inside the game loop, print out each racers' current disctance travelled
#Is there anything else that needs to go inside the game loop?
#If not, it means we have a winning Jeep Sheep! Outside the game loop, write some code to determine which index in the racers array stores the biggest value.
#Use the index to grab the winning sheep's name and compare it to the player's prediciton. Did the player win?!
During the development of the game, your advisor has suggested that the game is too simple and not very exciting.
Together, you brainstormed a list of possible scenarios for the game. You also agreed that the rules of the game must remain the same:
Here is a list of possibilities. You can add to it with your own ideas.
A sheep crashes along the way and is unable to finish... along with a dramatic message which is displayed... or has to call for help and gets a distance penalty of -100m
There could be some random obstacles on the track like glue or tar which slow a sheep down if they get stuck in it...
Each car starts with a certain fuel level. They know that if they have a lighter jeep, they can go faster. But it's risky to be too light and make a fuel misjudgement.
Some visual --- to represent how each sheep is doing during the race is displayed eg:
Jack ----
Joe --
Jill -----
If two jeeps bump, they both miss a turn to move forward and a dramatic message is displayed Joe and Bob just bumped!
Or.........
This discussion has been recored in the Record of Tasks, along with all of the other major tasks that you have completed so far.
Continue to (re)design the game. Try and use as many of the skills that you have eg:
This is usually done before coding begins! However, let's think about it now.
Create a short document in which you outline an approach to solving part of the problem eg maybe the design of a function.
Draw a flowchart which represents the code you have chosen to outline.
In your document select another block of code which implements part of the solutuion eg maybe the design of a function.
Write IB standard pseudocode for this block of code.
The generation of test documentation is usually done before coding begins! However, let's take a look at an example of testing now - whitebox testing
Identify an algorithm which is formed by using a loop. Decide on a set of test data. Create a trace table which would show the expected output/result of running the test data.
For example, you could create a sample set of distance data in the game loop and show how the game loop should end.
Use the course guide to find the assessment criteria for the video. Create a video which you belive will give you maximum points according to the assessment criteria.
Make sure you are thoughtful when testing your solution.
If your code has a validation check, test your code with acceptable/valid data and unacceptable/invalid data.