mirror of
https://github.com/SashLilac/cambridge-modpack.git
synced 2024-12-26 23:49:02 -06:00
19 lines
395 B
Lua
19 lines
395 B
Lua
local Randomizer = require 'tetris.randomizers.randomizer'
|
|
|
|
local NES = Randomizer:extend()
|
|
|
|
function NES:initialize()
|
|
self.history = 0
|
|
self.shapes = {"I", "J", "L", "O", "S", "T", "Z"}
|
|
end
|
|
|
|
function NES:generatePiece()
|
|
local x = love.math.random(8)
|
|
if x == 8 or x == self.history then
|
|
x = love.math.random(7)
|
|
end
|
|
self.history = x
|
|
return self.shapes[x]
|
|
end
|
|
|
|
return NES |