Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function clearplayfield()
- for x = 0x6, 0x8, 2 do
- for y = 0x02, 0x0B do
- memory.writebyte(0xC800 + (x * 0x10) + y, 0x2F);
- end;
- end;
- end;
- piecevalues = {
- [0x00] = "L",
- [0x04] = "J",
- [0x08] = "I",
- [0x0C] = "O",
- [0x10] = "Z",
- [0x14] = "S",
- [0x18] = "T",
- };
- pieces = {};
- for k,v in pairs(piecevalues) do
- pieces[k] = 0;
- end;
- sum = 0;
- print("butt");
- donepiece = true;
- while true do
- if not donepiece and memory.readbyte(0xC201) == 0x18 then
- clearplayfield();
- local curpiece = memory.readbyte(0xC203);
- donepiece = true;
- pieces[curpiece] = pieces[curpiece] + 1;
- sum = sum + 1;
- elseif donepiece and memory.readbyte(0xC201) ~= 0x18 then
- donepiece = false;
- end;
- local temp = 0;
- inpt = input.get();
- if inpt['X'] then
- gui.box(96, 0, 159, 144, 0x000000af, 0x000000ff);
- for k,v in pairs(piecevalues) do
- gui.text(100, temp * 7, string.format("%s %6d %5.2f%%", v, pieces[k], pieces[k] / sum * 100));
- temp = temp + 1;
- end;
- temp = temp + 1;
- end;
- gui.text(100, temp * 7, string.format("%8d", sum));
- emu.frameadvance();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement