Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

ACTIVITY 12

Written Description
Choose the number of players.

Set up a color wheel.

Allow the users to spin the wheel.

Decide which topic will be displayed according to the colors.

Show the topic and questions for each player.

Check the answers whether they are correct or not.

Give two points to a correct answer at the first attempt.

Give one point to a correct answer at the second attempt.

Calculate the scores for each player.

Show as a winner when someone reach 30 points and end the game.

Allow the user to select a new game or finish.

Pseudocode
SEND “Please enter the number of players, two or three or four.” TO DISPLAY

RECEIVE numPlayers FROM KEYBOARD

SET index TO 1

SET colors TO [“Red”,”Blue”,”Green”,”Yellow”]

SET score TO 0

WHILE NOT score=30 DO

IF (numPlayers≥2) OR (numPlayers≤4) THEN

SEND “Please spin the wheel” TO DISPLAY

RECEIVE spinColor FROM KEYBOARD

IF spincolor=color[index] THEN

SEND “Your topic is science” TO DISPLAY

SEND “science question” TO DISPLAY

RECEIVE answer FROM KEYBOARD


IF answer IS CORRECT THEN

SEND “You gain 2 points” TO DISPLAY

SET score TO score+2

ELSE

SEND “You have 1 more chance” TO DISPLAY

RECEIVE answer2 FROM KEYBOARD

IF answer2 IS CORRECT THEN

SEND “You gain 1 point” TO DISPLAY

ELSE

SEND “You gain no point” TO DISPLAY

END IF

END IF

ELSE

IF spincolor=color[index+1] THEN

SEND “Your topic is history” TO DISPLAY

SEND “history question” TO DISPLAY

RECEIVE answer FROM KEYBOARD

IF answer IS CORRECT THEN

SEND “You gain 2 points” TO DISPLAY

SET score TO score+2

ELSE

SEND “You have 1 more chance” TO DISPLAY

RECEIVE answer2 FROM KEYBOARD

IF answer2 IS CORRECT THEN

SEND “You gain 1 point” TO DISPLAY

ELSE

SEND “You gain no point” TO DISPLAY

END IF
END IF

ELSE

IF spincolor=color[index+2] THEN

SEND “Your topic is general knowledge” TO DISPLAY

SEND “general knowledge question” TO DISPLAY

RECEIVE answer FROM KEYBOARD

IF answer IS CORRECT THEN

SEND “You gain 2 points” TO DISPLAY

SET score TO score+2

ELSE

SEND “You have 1 more chance” TO DISPLAY

RECEIVE answer2 FROM KEYBOARD

IF answer2 IS CORRECT THEN

SEND “You gain 1 point” TO DISPLAY

ELSE

SEND “You gain no point” TO DISPLAY

END IF

END IF

ELSE

IF spincolor=color[index+3] THEN

SEND “Your topic is geography” TO DISPLAY

SEND “geography question” TO DISPLAY

RECEIVE answer FROM KEYBOARD

IF answer IS CORRECT THEN

SEND “You gain 2 points” TO DISPLAY

SET score TO score+2

ELSE

SEND “You have 1 more chance” TO DISPLAY


RECEIVE answer2 FROM KEYBOARD

IF answer2 IS CORRECT THEN

SEND “You gain 1 point” TO DISPLAY

ELSE

SEND “You gain no point” TO DISPLAY

END IF

END IF

END IF

END IF

END IF

END IF

END WHILE

You might also like