Mastermind: Difference between revisions

m
m (will -> may)
Line 754:
[https://easylang.online/apps/mastermind.html Run it]
 
<lang>col[] = [ 902802 990 171 229 960950 808 ]
<lang>intvars
col[] = [ 902 990 171 229 960 808 ]
len code[] 4
len guess[] 4
Line 765 ⟶ 764:
for j range 2
for c range 2
move c * 3.5 + 7671.5 r * 11.5 + 10.4 + j * 3.5
if black > 0
color 000
Line 783 ⟶ 782:
func show_code . .
color 531
move 2722 0
rect 46 8
for i range 4
move i * 8 + 3328 3
color col[code[i]]
circle 2
Line 793 ⟶ 792:
func draw_guess . .
for c range 4
move c * 12 + 2520 row * 11.5 + 12
color col[guess[c]]
circle 3.8
Line 801 ⟶ 800:
color 420
linewidth 11
move 2217 row * 11.5 + 12
line 6560 row * 11.5 + 12
call draw_guess
move 7873.5 row * 11.5 + 12
color 310
circle 5.0
move 75.7 row * 11.5 + 9.8
color 753
move 7571.75 row * 11.5 + 9.8.5
text "OK"
textsize 7
text "OK"
.
func rate . .
move 7873.5 row * 11.5 + 12
color 531
circle 5.2
Line 836:
color 531
linewidth 12
move 2217 row * 11.5 + 12
line 6560 row * 11.5 + 12
call draw_guess
row -= 1
Line 859:
.
color 531
move 1510 10
rect 70 80
linewidth 10
move 105 5
line 105 95
line 9085 95
line 9085 5
line 105 5
color 310
linewidth 7
move 3328 3.5
line 6358 3.5
move 3530 1
color 864
textsize 4.5
Line 877:
color 310
linewidth 0.5
move 1510 10
line 1510 96
move 7267 10
line 7267 96
move 8580 10
line 8580 96
for r range 8
for c range 4
move c * 12 + 2520 r * 11.5 + 12
circle 2
.
call draw_rate r 0 0
.
guess[0] = 0
for i range 4
guess[i1] = i0
guess[2] = 1
.
guess[3] = 1
call next_row
.
func do_move . .
c = floor ((mouse_x - 2015) /div 12)
guess[c] = (guess[c] + 1) mod 6
call draw_guess
Line 904 ⟶ 905:
call new
elif mouse_y > row * 11.5 + 7 and mouse_y < row * 11.5 + 17
if mouse_x > 2015 and mouse_x < 6661
call do_move
elif mouse_x > 7267 and mouse_x < 8580
call rate
.
2,044

edits