mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
examples: update [0;n]
to [0].repeat(n)
This commit is contained in:

committed by
Alexander Medvednikov

parent
854de4e7e0
commit
5f43a61e0d
@ -167,7 +167,7 @@ fn (g mut Game) init_game() {
|
||||
g.field = []array_int // TODO: g.field = [][]int
|
||||
// Generate the field, fill it with 0's, add -1's on each edge
|
||||
for i := 0; i < FieldHeight + 2; i++ {
|
||||
mut row := [0; FieldWidth + 2]
|
||||
mut row := [0].repeat(FieldWidth + 2)
|
||||
row[0] = - 1
|
||||
row[FieldWidth + 1] = - 1
|
||||
g.field << row
|
||||
|
Reference in New Issue
Block a user