ENG Yachtzee punktiarvestus: erinevus redaktsioonide vahel

Allikas: Lambda
Mine navigeerimisribale Mine otsikasti
Anier (arutelu | kaastöö)
Resümee puudub
 
Anier (arutelu | kaastöö)
PResümee puudub
5. rida: 5. rida:
** For example: if a player hits quad 4, then you enter 16
** For example: if a player hits quad 4, then you enter 16
** Alternatively one could enter 4 and the program would multiply 4x4 internally
** Alternatively one could enter 4 and the program would multiply 4x4 internally
* Program has to calculate "upper section" bonus points automatically
* Program has to calculate '''"upper section" bonus points automatically
* Program must sum the player scores automatically and show it in the table
* Program must '''sum the player scores automatically''' and show it in the table
* Program has to mark the '''current leader
* Program has to mark the '''current leader
** With an * at the back of the score
** With an * at the back of the score

Redaktsioon: 8. september 2010, kell 13:46

  • ImplementYachtzee game scoring program
  • Any number of players
  • Player score is entered "directly", withoud additional calculus
    • For example: if a player hits quad 4, then you enter 16
    • Alternatively one could enter 4 and the program would multiply 4x4 internally
  • Program has to calculate "upper section" bonus points automatically
  • Program must sum the player scores automatically and show it in the table
  • Program has to mark the current leader
    • With an * at the back of the score
  • Table fields have to be with constant length
    • which means - if the field score is 1 or 11, the column alignment would not be messed up
  • Entering scores
    • Choose a player to enter score to
    • Choose the "trick" the points are awarded by
    • Point for that trick
    • Don't auto-rotate player turns
  • You have to use classes and objects to hold in-memory data
  • Use Checkstyle
    • Upon which the main idea is to comment your source code


  • Everybody has 0 pts. at the beginning of the game - don't mark the leader.
  • If there are multiple leaders - players with same (high-) scores - you mark all of them as leaders


Example output:

 nimi   | 1 | 2 | 3 | 4 | 5 | B | T | Q | FH | LS | HS | Y | C |  T
--------+---+---+---+---+---+---+---+---+----+----+----+---+---+----
aadu	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  13*
beedu	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12
ceedu	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12
...	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12

-> _

Incorrect column alignment:

 nimi   | 1 | 2 | 3 | 4 | 5 | B | T | Q | FH | LS | HS | Y | C |  T
--------+---+---+---+---+---+---+---+---+----+----+----+---+---+----
aadu	|  10|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  23*
beedu	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12
ceedu	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12
...	|  0|  0|  0|  0|  0|  0|  0|  0|   0|   0|   0|  0|  0|  12

-> _