-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJuego_de_mapas.m
51 lines (51 loc) · 1.94 KB
/
Juego_de_mapas.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Score=0;
Countries=randperm(13);
mymap=[0 0.4470 0.7410
0.8500 0.3250 0.0980
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.4660 0.6740 0.1880
0.3010 0.7450 0.9330
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.3010 0.7450 0.9330
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.4660 0.6740 0.1880
0.3010 0.7450 0.9330
0.6350 0.0780 0.1840
0 0.4470 0.7410];
prompt='Do you want to play a game? (Y to continue)';
answer=input(prompt, 's');
tf=strcmpi(answer,'Y');
if tf==1
for round=1:13
Question=Countries(round);
mymap=[0 0.4470 0.7410
0.8500 0.3250 0.0980
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.4660 0.6740 0.1880
0.3010 0.7450 0.9330
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.3010 0.7450 0.9330
0.9290 0.6940 0.1250
0.4940 0.1840 0.5560
0.4660 0.6740 0.1880
0.3010 0.7450 0.9330
0.6350 0.0780 0.1840
0 0.4470 0.7410];
mymap((Question+1), 1:3)=[0 0 0];
image(map),colormap(mymap);text(500,900,'1. Brazil'); text(500,950,'2. Argentina'); text(500,1000,'3. Uruguay'); text(500,1050,'4. Paraguay'); text(500,1100,'5. Colombia');text(500,1150,'6. French Guyana'); text(500,1200,'7. Suriname'); text(650,900,'8. Guyana'); text(650,950,'9. Equador'); text(650,1000,'10. Peru'); text(650,1050,'11. Chile'); text(650,1100,'12. Bolivia'); text(650,1150,'13. Venezuela');axis('off')
prompt='Which country is blacked out? (1-13) ';
answer=input(prompt);
if answer==Question
Score=Score+1;
end
end
Score=num2str(Score);
['Your score is ' , Score, ' out of 13.']
else
'Sorry, please try again.';
end