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:
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user