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

ci: build tetris with -autofree

This commit is contained in:
Alexander Medvednikov 2020-11-27 20:41:17 +01:00
parent 13948152b6
commit f135a9949c
2 changed files with 8 additions and 3 deletions

View File

@ -169,6 +169,9 @@ jobs:
run: VJOBS=1 ./v -silent test-fixed run: VJOBS=1 ./v -silent test-fixed
- name: Build examples - name: Build examples
run: ./v -silent build-examples run: ./v -silent build-examples
- name: Build examples with -autofree
run: |
./v -autofree -experimental -o tetris examples/tetris/tetris.v && ./tetris
- name: v doctor - name: v doctor
run: | run: |
./v doctor ./v doctor
@ -228,6 +231,9 @@ jobs:
run: ./v -o vprod -prod cmd/v && ./vprod -silent test-fixed run: ./v -o vprod -prod cmd/v && ./vprod -silent test-fixed
- name: Build examples - name: Build examples
run: ./v -silent build-examples run: ./v -silent build-examples
- name: Build examples with -autofree
run: |
./v -autofree -experimental -o tetris examples/tetris/tetris.v && ./tetris
- name: Build modules - name: Build modules
run: | run: |
./v build-module vlib/os ./v build-module vlib/os

View File

@ -177,7 +177,7 @@ fn (mut g Game) init_game() {
mut row := [0].repeat(field_width + 2) mut row := [0].repeat(field_width + 2)
row[0] = -1 row[0] = -1
row[field_width + 1] = -1 row[field_width + 1] = -1
g.field << row g.field << row.clone()
} }
for j in 0 .. field_width + 2 { for j in 0 .. field_width + 2 {
g.field[0][j] = -1 g.field[0][j] = -1
@ -264,8 +264,7 @@ fn (mut g Game) move_right(dx int) bool {
tetro := g.tetro[i] tetro := g.tetro[i]
y := tetro.y + g.pos_y y := tetro.y + g.pos_y
x := tetro.x + g.pos_x + dx x := tetro.x + g.pos_x + dx
row := g.field[y] if g.field[y][x] != 0 {
if row[x] != 0 {
// Do not move // Do not move
return false return false
} }