1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: fix compilation with -prod

This commit is contained in:
Alexander Medvednikov
2021-04-23 14:48:04 +03:00
parent cf497623dc
commit 0567cbe431
6 changed files with 23 additions and 20 deletions

View File

@@ -455,7 +455,6 @@ fn (mut app App) ai_move() {
move_idx := int(move)
predictions[move_idx].move = move
mut mpoints := 0
mut mshifts := 0
mut mcmoves := 0
for _ in 0 .. predictions_per_move {
mut cboard := app.board
@@ -479,7 +478,6 @@ fn (mut app App) ai_move() {
}
}
mpoints += cboard.points
mshifts += cboard.shifts
mcmoves += cmoves
}
predictions[move_idx].mpoints = f64(mpoints) / predictions_per_move

View File

@@ -23,6 +23,7 @@ pub fn (a &A2D) set(x int, y int, newval int) {
mut e := &int(0)
e = a.data + y * a.maxx + x
*e = newval
_ = e // TODO compiler bug, this is not necessary
}
}
@@ -31,6 +32,7 @@ pub fn (a &A2D) get(x int, y int) int {
unsafe {
mut e := &int(0)
e = a.data + y * a.maxx + x
_ = e
return *e
}
}