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

examples: fix compilation of game_of_life due to type mismatch

This commit is contained in:
Pradeep Verghese 2020-05-29 12:15:20 +05:30 committed by GitHub
parent 0970e61350
commit b52c98ac43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,8 +46,9 @@ fn new_automaton(f [][]int) Automaton {
maxx = f[y].len
}
}
field := &A2D{ maxx: maxx maxy: maxy data: &int( vcalloc( sizeof(int) * maxy * maxx ) ) }
new_field := &A2D{ maxx: maxx maxy: maxy data: &int( vcalloc( sizeof(int) * maxy * maxx ) ) }
size := u32(maxx * maxy)
field := &A2D{ maxx: maxx maxy: maxy data: &int( vcalloc( sizeof(int) * size ) ) }
new_field := &A2D{ maxx: maxx maxy: maxy data: &int( vcalloc( sizeof(int) * size) ) }
for y in 0..field.maxy {
for x in 0..field.maxx {
field.set( x, y, f[y][x] )