Mastermind: Difference between revisions

m
m (Minor code alteration.)
Line 1,143:
=={{header|EasyLang}}==
 
[https://easylang.onlinedev/apps/mastermind.html Run it]
 
<syntaxhighlight lang="text">
# Mastermind:w90
#
col[] = [ 802 990 171 229 950 808 ]
len code[] 4
Line 1,194 ⟶ 1,196:
move 17 row * 11.5 + 7.5
line 60 row * 11.5 + 7.5
call draw_guess
move 73.5 row * 11.5 + 7.5
color 310
Line 1,225 ⟶ 1,227:
.
.
call draw_rate row black white
color 531
linewidth 12
move 17 row * 11.5 + 7.5
line 60 row * 11.5 + 7.5
call draw_guess
row += 1
if black = 4
Line 1,236 ⟶ 1,238:
.
if row = 8
call show_code
timer 2
else
call next_row
.
.
Line 1,246 ⟶ 1,248:
.
proc new . .
call init_vars
for i to 4
code[i] = random 6
Line 1,280 ⟶ 1,282:
circle 2
.
call draw_rate r 0 0
.
guess[1] = 1
Line 1,286 ⟶ 1,288:
guess[3] = 2
guess[4] = 2
call next_row
.
proc do_move . .
c = (mouse_x - 15) div 12
guess[c + 1] = guess[c + 1] mod 6 + 1
call draw_guess
.
on mouse_down
if row = -2
call new
elif mouse_y > row * 11.5 + 0.5 and mouse_y < row * 11.5 + 10.5 and row < 8
if mouse_x > 15 and mouse_x < 61
call do_move
elif mouse_x > 67 and mouse_x < 80
call rate
.
.
.
call new
</syntaxhighlight>
 
1,969

edits