examples: fix compilation of game_of_life due to type mismatch

pull/5119/head
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
1 changed files with 3 additions and 2 deletions

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] )