Advertisement
Guest User

Untitled

a guest
May 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5. #include <math.h>
  6.  
  7. #define MOLTIPLICATORE_PEDAGGIO 1
  8. #define BATCAVERNA 30
  9. #define BAGNI 10
  10. #define SCRIVANIA 1
  11. #define TENDA 2
  12.  
  13. typedef enum{Terreno, Sfiga, Tasse, Corridoio, Via, Batcaverna} Tipologia_Terreno;
  14.  
  15. typedef struct Terreno_Struttura{
  16. char Nome[50+1];
  17. Tipologia_Terreno Tipo;
  18. float Valore;
  19. int Posizione;
  20. char Proprietario[100+1];
  21. int Costruzioni;
  22. } Terreno_Struttura;
  23.  
  24. typedef struct Giocatore{
  25. char Nome[100+1];
  26. float Credito;
  27. int Posizione;
  28. int Turni_Prigione;
  29. } Giocatore;
  30.  
  31. //Tira_Dado restituisce un intero casuale compreso tra 1 e 6
  32.  
  33. int Tira_Dado(){
  34. int dado = 0;
  35. srand(time(NULL));
  36. dado = rand()% 6+1;
  37. return dado;
  38. }
  39.  
  40. Tipologia_Terreno Ottieni_Tipologia_Terreno(int indice_terreno){
  41. int tipo;
  42. if(indice_terreno == BAGNI){
  43. tipo =
  44. }
  45. }
  46.  
  47. int main()
  48. {
  49. int numero_giocatori = 0, i = 0, j = 0, scelta_menu = 0, dado1 = 0, dado2 = 0;
  50. int tipo_terreno[40] = {5,1,2,1,1,3,1,2,1,1,4,1,2,1,1,3,1,2,1,1,4,1,2,1,1,3,1,2,1,1,6,1,2,1,1,3,1,2,1,1};
  51. float costo_terreno[40] = {0,60,0,60,80,0,100,0,100,120,0,140,0,140,160,0,180,0,180,200,0,220,0,220,240,0,260,0,260,280,0,300,0,300,320,0,360,0,360,400};
  52. char nome_terreno[40][50+1] = {"VIA!", "AULA G", "SFIGA!", "AULA C", "AULA F", "TASSE!", "AULA STUDIO", "SFIGA!", "SIMAZ", "LAB T", "BAGNI", "VAX", "SFIGA!", "G.A.R.", "BIBLIOTECA", "TASSE!", "AULA B", "SFIGA!", "SEGRETERIA", "AULA A", "CORRIDOIO", "UFFICIO SCATENI", "SFIGA!", "BAGNO PROF.", "AULA D", "TASSE!", "LAB 3", "SFIGA!", "LAB 4", "LAB M", "BATCAVERNA!", "AULA M FISICA", "SFIGA!", "AULA M CHIMICA", "AULA M MATEMATICA", "TASSE!", "BAR ROTONDO", "SFIGA!", "AULA ANATOMICA", "AULA COSTA"};
  53. Terreno_Struttura Tabellone[40];
  54. Giocatore Giocatori[numero_giocatori];
  55. printf("Monopoly: Palazzo delle Scienze Edition\n\n");
  56. printf("1 - Nuova Partita\n2 - Carica Partita\n\n");
  57. scanf("%d", &scelta_menu);
  58. while(scelta_menu != 1 && scelta_menu != 2){
  59. printf("\nScelta non valida, inserisci 1 per iniziare una nuova partita o 2 per caricare una vecchia partita\n\n");
  60. scanf("%d", &scelta_menu);
  61. }
  62. if(scelta_menu == 1){
  63. for(i = 0; i < 40; i++){
  64. strcpy(Tabellone[i].Nome, nome_terreno[i]);
  65. Tabellone[i].Valore = costo_terreno[i];
  66. Tabellone[i].Posizione = i+1;
  67. Tabellone[i].Costruzioni = 0;
  68.  
  69. }
  70. }
  71. return 0;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement