Mastermind: Difference between revisions
m
→{{header|EasyLang}}
m (will -> may) |
|||
Line 754:
[https://easylang.online/apps/mastermind.html Run it]
▲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 +
if black > 0
color 000
Line 783 ⟶ 782:
func show_code . .
color 531
move
rect 46 8
for i range 4
move i * 8 +
color col[code[i]]
circle 2
Line 793 ⟶ 792:
func draw_guess . .
for c range 4
move c * 12 +
color col[guess[c]]
circle 3.8
Line 801 ⟶ 800:
color 420
linewidth 11
move
line
call draw_guess
move
color 310
circle 5.0
move 75.7 row * 11.5 + 9.8▼
color 753
text "OK"▼
textsize 7
.
func rate . .
move
color 531
circle 5.2
Line 836:
color 531
linewidth 12
move
line
call draw_guess
row -= 1
Line 859:
.
color 531
move
rect 70 80
linewidth 10
move
line
line
line
line
color 310
linewidth 7
move
line
move
color 864
textsize 4.5
Line 877:
color 310
linewidth 0.5
move
line
move
line
move
line
for r range 8
for c range 4
move c * 12 +
circle 2
.
call draw_rate r 0 0
.
guess[0] = 0
guess[2] = 1
guess[3] = 1
call next_row
.
func do_move . .
c =
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 >
call do_move
elif mouse_x >
call rate
.
|