Ver código fonte

Este no esta como la version del libro ya que tenia cambios mas actualizados como diagnosticas y pseudo-codigo

Luis Albertorio 8 anos atrás
pai
commit
55486e3620
2 arquivos alterados com 35 adições e 14 exclusões
  1. 21
    0
      README-en.md
  2. 14
    14
      README-es.md

+ 21
- 0
README-en.md Ver arquivo

@@ -41,6 +41,27 @@ Before coming to the laboratory you should have:
41 41
 
42 42
 The skeleton for the program that we provide simulates a basketball game between two players. The successful throws into the basket receive two points. The data is initiated with the name of each player and the global statistics in the "tournament": total of games played, attempted throws, successful throws and rebounds. The program includes random functions and formulas to determine the player that attempts a throw, if the player scores, and  the player that takes the rebound. During the simulated game the score for each player is kept and each player's data is updated. At the end of the game, a table with the statistics is displayed.
43 43
 
44
+The algorithm that simulates the game is the following:
45
+
46
+```
47
+1. init the player
48
+2. assign jugadorEnOfensiva randomly
49
+3. while (none has won)
50
+4.   simulate a shot to the basket
51
+5.   if (scored)
52
+6.     update the statistics of the player that shot the basket
53
+7.     if (the score >= 32):
54
+8.        inform that the offense player (jugadorEnOfensiva) won 
55
+9.     else:
56
+10.       exchange offensive player
57
+11.  else:
58
+12.    update statistics of the player that shot the basket
59
+13.    determine who gets the rebound
60
+14.    update the statistics of the player that got the rebound
61
+15.    assign a pleyer in offense (jugadorEnOfensiva)
62
+16. show the players statistics
63
+```
64
+
44 65
 ---
45 66
 
46 67
 ###The `BBPlayer` Class

+ 14
- 14
README-es.md Ver arquivo

@@ -49,20 +49,20 @@ El algoritmo que simula el juego es el siguiente:
49 49
 ```
50 50
 1.  inicializar jugadores
51 51
 2.  asignar jugadorEnOfensiva aleatoriamente
52
-2.  while (ninguno ha ganado):
53
-3.    simular tiro al canasto
54
-4.    if (anotó):
55
-5.      actualizar estadisticas de quien tiró al canasto
56
-6.      if (puntuación >= 32):
57
-7.        informar que jugadorEnOfensiva ganó
58
-8.      else:
59
-9.        intercambiar jugadorEnOfensiva
60
-10.   else:
61
-11.     actualizar estadisticas de quien tiró al canasto
62
-11.     determinar quien atrapa rebote
63
-12.     actualizar estadisticas de quien atrapó rebote
64
-13.     asignar jugadorEnOfensiva
65
-14. mostrar estadísticas de los jugadores
52
+3.  while (ninguno ha ganado):
53
+4.    simular tiro al canasto
54
+5.    if (anotó):
55
+6.      actualizar estadisticas de quien tiró al canasto
56
+7.      if (puntuación >= 32):
57
+8.        informar que jugadorEnOfensiva ganó
58
+9.      else:
59
+10.        intercambiar jugadorEnOfensiva
60
+11.   else:
61
+12.     actualizar estadisticas de quien tiró al canasto
62
+13.     determinar quien atrapa rebote
63
+14.     actualizar estadisticas de quien atrapó rebote
64
+15.     asignar jugadorEnOfensiva
65
+16. mostrar estadísticas de los jugadores
66 66
 ```
67 67
 
68 68
 ---