simon game

완료 등록 시간: 1년 전 착불
완료 착불

We want to develop a program that implements a simple version of the game.

There are 4 colour LEDs: red, yellow, blue, green

There are two LEDs to indicate wining or losing a game.

There are 4 corresponding push-button switches.

The maximum sequence length of colours is fixed at 5, although it should be "easily" modifiable to be longer/shorter.

The Game:

A sequence of colors are shown to the player. These colours are chosen randomly by the program and they should change for any new game.

The player should memorize these colours and reproduce the same sequence by pushing the corresponding buttons.

The game always uses 5 random colours as the sequence for each game, but the game is played in stages of difficulty. First, the program displays a single colour (displayed on the corresponding LED by blinking once) and the player is to remember and push correctly the corresponding push button. If players is incorrect, the program notifies that the game is lost and starts over a new game (with a new random sequence of colours).

Otherwise, if the player remembers the correct colour and pushes the corresponding button correctly, the program uses the colours from the last stage and adds another randomly chosen colour to the end of the sequence. The player should remember and in the correct order push the corresponding buttons. If players is incorrect, the program notifies that the game is lost and starts over a new game (with a new random sequence of colours). Otherwise, the program shows the previous sequence of colours plus a new one added to its end. So first there is 1 colour, then 2 colours, then 3 colours ... up to 5 colours for the last stage.

The game ends at the end of each stage as soon as the player makes a mistake, or if the player wins (following the pattern all the way up to the pre-set maximum length of the sequence which is 5 in our program). Your program should start a new game right after a win or a loss.

So we consider "one" game to be from displaying of the first single colour till the user losses or the user wins. At this point, a new game is always started again.

For every new game:

generate a random sequence of 5 numbers each number representing a colour

start with the first colour in the above sequence, that is, N=1

repeat (until this game is lost or won)

turn on (flash) the first N LEDs in the sequence one by one

read the user's input (i.e. read the buttons)

if the user gets it correctly

if N equals to the sequence length

the user wins (flash the green LED for 5 seconds to indicate a win)

start a new game

else

increment N

else

the user loses (flash the red LED for 5 seconds to indicate a lose)

start a new game

For any aspect of the game that has not been explicitly specified here (that is left for you to decide on), make a design decision with the aim to make your game as user-friendly as possible and your code as readable as possible.

The program turns on all LEDs for 2 seconds and then turn them off for 2 seconds to indicate the start of a new game.

For the timing for other blinking, choose user-friendly on/off times. Use practical and reasonable timing (not too long nor too short) (your choice).

You must not limit the player on how to press the buttons. It should not matter if the player push the button for any duration s/he desires.

Although we are are considering a max sequence length of colours to be 5, your code should be such that the max length can be "easily" modifiable to be longer/shorter.

As shown in the demo screencast, have a visual feedback of turning on the associated LED when the user presses any of the pushbuttons. Similarly the turning on of all LEDs at the beginning of the game as demoed.

Avoid redundant, trivial or repetitive implementations. Write the best code you can using the programming and C language concepts you have learned in the course: repetition, branching, modularity, ...

Absolutely no global variable in your code.

Include sufficient and useful comment statements.

C 프로그래밍

프로젝트 ID: #33959585

프로젝트 소개

9 건(제안서) 재택 근무형 프로젝트 서비스 이용 중: 1년 전

수상자:

anamali7886

Hello, I'll create your landing web page enticing simple, cool and attractive which will easily grab your targeted audience attention featuring [login to view URL] as per your need and requirement. I am a Full-Stack develop 기타

$20 CAD (7일 이내)
(1 리뷰)
1.3

이 일자리에 대한 프리랜서 9 명의 평균 입찰가: $63

esa59cfdec1d6569

Hi there, I checked your requirements and guarantee you it's gonna be done within the next few hours. Let's contact via chat so that I can start work immediately. Wish you the best.

$20 CAD (7일 이내)
(73 리뷰)
5.3
theatasolution1

hi I am really interested in your project But I have full experience of c,C++ programming I could finish your project in high quality, in short timeline I could satisfy you Everything will be done well if you work wit 기타

$20 CAD (1일 이내)
(13 리뷰)
3.8
etalhak

Hello, I am an electronics and telecommunication engineer and my major is wireless systems' design. I am experienced in hardware and embedded systems' design. I have designed/printed/tested many PCBs. I have checked yo 기타

$50 CAD (2일 이내)
(3 리뷰)
2.1
braincenter

Hello, Hope this message finds you well, I checked your details and I believe that my experience is what you are looking 4. I have been working on similar projects for the past 8 years, and I have the essential skills 기타

$150 CAD (7일 이내)
(5 리뷰)
3.5
bernardkanyumu40

GAME DEVELOPER C++ EXPERT PHD SOFTWARE DEVELOPER DEAR EMPLOYER, I’ve completed the exact same projects before successfully. Awarding me will be the fastest way to complete your task with the best rates possible. I CAN 기타

$20 CAD (1일 이내)
(0 리뷰)
0.0
serhiikhla503

Hi, there I understood full flow of your game and also checked your screen shot which looks like a circuit Let's discuss with me.

$20 CAD (7일 이내)
(0 리뷰)
0.0
varu0913

i am good in c programming so I am able to complete it in on time so consider me I hope I will do my best

$20 CAD (4일 이내)
(0 리뷰)
0.0