remove type hints from declarations
This commit is contained in:
@@ -201,7 +201,7 @@ func CHIP8.step[c: CHIP8] : void
|
||||
else if n == 0x3
|
||||
c->reg[x] = c->reg[x] ^ c->reg[y]
|
||||
else if n == 0x4
|
||||
res : u8 = c->reg[x] + c->reg[y]
|
||||
res := c->reg[x] + c->reg[y]
|
||||
c->reg[0xf] = (res > 0xff) as u8
|
||||
c->reg[x] = res
|
||||
else if n == 0x5
|
||||
@@ -230,8 +230,8 @@ func CHIP8.step[c: CHIP8] : void
|
||||
for row in 0..n
|
||||
for col in 0..8
|
||||
if (c->memory[c->I + row] & (0x80 >> col)) != 0
|
||||
pixel_x : u8 = (c->reg[x] + col) % 64
|
||||
pixel_y : u8 = (c->reg[y] + row) % 32
|
||||
pixel_x := (c->reg[x] + col) % 64
|
||||
pixel_y := (c->reg[y] + row) % 32
|
||||
offset := pixel_x as i64 + (pixel_y * 64)
|
||||
|
||||
if c->display[offset] == 1
|
||||
|
||||
@@ -30,10 +30,10 @@ func main[] : i64
|
||||
|
||||
for i in 0..N-3
|
||||
for j in 0..N-3
|
||||
h : i64 = grid->nth(i)->nth(j) * grid->nth(i)->nth(j+1) * grid->nth(i)->nth(j+2) * grid->nth(i)->nth(j+3)
|
||||
v : i64 = grid->nth(j)->nth(i) * grid->nth(j+1)->nth(i) * grid->nth(j+2)->nth(i) * grid->nth(j+3)->nth(i)
|
||||
d1 : i64 = grid->nth(i)->nth(j) * grid->nth(i+1)->nth(j+1) * grid->nth(i+2)->nth(j+2) * grid->nth(i+3)->nth(j+3)
|
||||
d2 : i64 = grid->nth(i)->nth(N-j-1) * grid->nth(i+1)->nth(N-j-2) * grid->nth(i+2)->nth(N-j-3) * grid->nth(i+3)->nth(N-j-4)
|
||||
h := grid->nth(i)->nth(j) * grid->nth(i)->nth(j+1) * grid->nth(i)->nth(j+2) * grid->nth(i)->nth(j+3)
|
||||
v := grid->nth(j)->nth(i) * grid->nth(j+1)->nth(i) * grid->nth(j+2)->nth(i) * grid->nth(j+3)->nth(i)
|
||||
d1 := grid->nth(i)->nth(j) * grid->nth(i+1)->nth(j+1) * grid->nth(i+2)->nth(j+2) * grid->nth(i+3)->nth(j+3)
|
||||
d2 := grid->nth(i)->nth(N-j-1) * grid->nth(i+1)->nth(N-j-2) * grid->nth(i+2)->nth(N-j-3) * grid->nth(i+3)->nth(N-j-4)
|
||||
out = math.max(out, math.max(h, math.max(v, math.max(d1, d2))))
|
||||
|
||||
io.println_i64(out)
|
||||
|
||||
@@ -7,7 +7,7 @@ func main[] : i64
|
||||
for j in 0..1000
|
||||
carry := 0
|
||||
for i in 0..n->size
|
||||
tmp : i64 = n->nth(i) * 2 + carry
|
||||
tmp := n->nth(i) * 2 + carry
|
||||
n->set(i, tmp % 10)
|
||||
carry = tmp / 10
|
||||
while carry > 0
|
||||
|
||||
@@ -4,7 +4,7 @@ include "$/containers.zr"
|
||||
func multiply[n: Array<i64>, x: i64] : void
|
||||
carry := 0
|
||||
for i in 0..n->size
|
||||
prod : i64 = n->nth(i) * x + carry
|
||||
prod := n->nth(i) * x + carry
|
||||
n->set(i, prod % 10)
|
||||
carry = prod / 10
|
||||
while carry > 0
|
||||
|
||||
@@ -8,7 +8,7 @@ func rule110_step[state: Array<bool>] : void
|
||||
left := false
|
||||
if i - 1 >= 0
|
||||
left = state->nth(i - 1)
|
||||
center : bool = state->nth(i)
|
||||
center := state->nth(i)
|
||||
right := false
|
||||
if i + 1 < state->size
|
||||
right = state->nth(i + 1)
|
||||
|
||||
Reference in New Issue
Block a user