summaryrefslogtreecommitdiff
path: root/tetris/engine.prn
blob: ebfb0c73a2c78d91c3d596a0c2808aa6bdfdabeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mkarray "e_blockqueue" store

@defun "e_nextblock" {
	"e_blockqueue" swapoutvar
	arrlen 1 < if
		"ERROR: blockqueue empty while requesting nextblock" print
		error
	end
	0 arridx
	swap
	arrpopf "e_blockqueue" store
}

@defun "e_peekblock" {
	"e_blockqueue" swapoutvar
	arrlen 2 < if
		0
	else
		1 arridx
	end
	swap
	"e_blockqueue" store
}