Hi I need help solving this program. I don't know where to begin and it is worth a major percentage of my grade!

조회 수: 15 (최근 30일)
I need to simulate a game from this website. http://www.darting.com/Darts-Rules/.
Program Structure:
You will be provided with two 512x512 matrices that represent a dart board. The first includes the value for each wedge around the board, the value in the matrix is the wedge value (or zero if you are off the board). For instance, if you select a number in the upper middle of the board (i.e. location 100,256) the resulting value will be 20. The second matrix indicates where the rings are for single, double or triple. In this case, each location has a value of 1 for single rings, 2 for double ring, 3 for triple ring, and zero if you are off the board.
You should use a random number generator to select one place on the dartboard, by row and column, which represents a dart throw. This location will be the same for both data matrices. Your code must display (i.e. triple – 14) where each dart hits (this can be done with text, it does not require a visual representation) for each round. Then display the current score for all players.
This process should continue until the game is successfully completed. Since you are using random number generators and not incorporating any skill into the throws the game simulation will likely take many rounds. When developing your code it might work better to start with small goals before trying to let the simulation run for an entire game.
  댓글 수: 6
mn n
mn n 2018년 4월 27일
Hey so I have a functional code I believe. But I keep getting an error.
darts(15,15) Index in position 1 exceeds array bounds (must not exceed 1).
Error in darts (line 22) wedge = (wedges(xw,yw));
what does this mean and how can I fix it?
Stephan
Stephan 2018년 4월 28일
Hi.
Please send your code, it is not possible to help without seeing whats going on.
Best regards
Stephan

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Board games에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by