The dice simulator and subsequent dice playing game was a Pre-2015 GCSE CS Controlled Assessment task from OCR. It is probably their most exciting coursework ever and is here so everyone gets a chance. It also contains hints on completing the CA well.
A game uses dice with 4, 6 and 12 sides to determine various outcomes.
Design, code and test a program that will simulate throwing dice with these numbers of sides.
The user should be able to input which dice is being thrown, eg 4, 6 or 12.
The program should output the dice chosen and the score, for example ‘6 sided dice thrown, score 4’
The user should be able to repeat this process as many times as required.
Create program that simulates a roll of a 4, 6 or 12 sided dice. The user will pick what dice is to be thrown the program will then output the result of the throw. This will be able to be done as many time as required.
When determining certain characteristics of a game character the numbers on a combination of dice are used to calculate certain attributes.
Two of these attributes are strength and skill.
At the start of the game, when the characters are created, a 4 sided dice and a 12 sided dice are thrown to determine values for each of these attributes using the following method for each character:
This process is repeated for each attribute for each character.
Describe this process using a suitable algorithm.
Write and test the code to determine these two attributes for a character and store the sample data for two characters, including suitable names, in a file.
I’m going to make the start of a game with two characters who each have two attributes ,strength and skill. These will be determined by a 4 and 12 sided dice being rolled then the value of the 12 sided dice will be divided by the value of the 4 sided dice. The result will then be rounded down then added to the initial attribute value of 10. This will be repeated for each attribute for each character. The game will then store a sample of the two attributes for both characters to a text file.
When there is an encounter between two characters the outcome is determined by the following process:
The program should:
I’m going to make a program that determines the outcome of an encounter it will allow the user to input the strength and skill for the two characters. The program will then take those values put then though an algorithm to make a strength and skill modifier. A dice will then be rolled for each player the one with the highest dice roll will get the modifiers added to their respected attributes, the one with the lowest will get the modifiers subtracted from their respected attributes. If any characters skill becomes zero or negative it will be stored as zero. If any characters strength becomes zero or negative that character dies this will be the end of the game.
This task was worth 45 Marks. It was a controlled assessment task that orginally appeared in OCR GCSE CS until Sept 2014. All rights and copyright to OCR. Please refer to the OCR Copyright Statement for further information. The example Intial Statements and Success Criteria are taken from A453 Sample Material High Band.