Question: C++ Instructions: Create a simple command line program that simulates the spinning of a roulette wheel like game. The landing positions of the wheel are
Instructions: Create a simple command line program that simulates the spinning of a roulette wheel like game. The landing positions of the wheel are to be stored in a circular (the last node should point to the first and visa-versa) doubly linked list. When the program is run, generate a random number between 1 and 400 and then cycle through the wheel displaying each value stopping when the randomly generated value matches the iteration. Display the final value. Finally repeat the process with a new random number and cycle through the wheel backwards. In building the doubly linked list, simply hard code the values using Wikipedia as a reference for the color and numbers and the order of the nodes for the double linked list (you may use an American or European style wheel). An example of running the program from the command line might be: rolldice2.exe 100 The resulting output should be similar to projecte5.exe Forwards Random number: 256 B4, r21, , ..I'm omitting a bunch or results here your program should shouw them....b17, r34 you landed on Red 34 Backwards Random number: 127: R25, B2, R21, B4....I'm omitting a bunch or results here your program should show them....R34, B17, R25 you landed on Red 25 Instructions: Create a simple command line program that simulates the spinning of a roulette wheel like game. The landing positions of the wheel are to be stored in a circular (the last node should point to the first and visa-versa) doubly linked list. When the program is run, generate a random number between 1 and 400 and then cycle through the wheel displaying each value stopping when the randomly generated value matches the iteration. Display the final value. Finally repeat the process with a new random number and cycle through the wheel backwards. In building the doubly linked list, simply hard code the values using Wikipedia as a reference for the color and numbers and the order of the nodes for the double linked list (you may use an American or European style wheel). An example of running the program from the command line might be: rolldice2.exe 100 The resulting output should be similar to projecte5.exe Forwards Random number: 256 B4, r21, , ..I'm omitting a bunch or results here your program should shouw them....b17, r34 you landed on Red 34 Backwards Random number: 127: R25, B2, R21, B4....I'm omitting a bunch or results here your program should show them....R34, B17, R25 you landed on Red 25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
