Ladrilho: Block Puzzle
README.md
ladrilho.duel
Ladrilho's 3-minute Duel, on Table Codes (roomsKit) rooms and blockPuzzleKit's replayable move logs.
- Lobby. Play a friend: roomsKit's own home screen (digit codes tapped on its keypad, a Back button to Ladrilho). The host starts the round from the room; an empty seat is filled by a computer player (roomsKit bot fill). Play the computer: Easy, Normal or Hard starts a private two-seat room with the computer in seat 2 at once.
- Same pieces. The host deals one seed; both boards run
Duel.rules(seed)(classic 8x8, classic pieces, thedailydealer, which never reads the board, so the pieces depend on the seed alone). - Clock.
startAt/endAtaremultiplayer.sessionTime()seconds in the room state, so every screen counts the same 3-2-1 and the same 3:00. BeforestartAtan overlay takes the taps. - Moves. Each machine plays its own board locally and sends its moves
{ slot, q, r, at }to the host (re-sent until the host confirms them). The host checks each move by replaying it, drops one made after 0:00, and publishes every seat's move log in the room state. - Opponent. Each machine applies the opponent's log to a second, non-interactive kit board (the
mini-board: above your board in portrait, in a left column in landscape) with
game:apply(move); its score is the opponent's score. - Computer players. The host plays every
botseat (from the start, or one that took over for someone who left) with the kit's AI (BP.Ai.new(level)and a time-slicedai:thinkjob) at a person's pace (Easy 2.6-4.6 s a move, Normal 1.8-3.4 s, Hard 1.3-2.6 s). A new host after host migration carries on from the published logs. - The end. At 0:00 plus a 1.2 s grace (or as soon as both boards are out of room) the host replays
both logs and publishes
result = { scores, lines, winner }: more points wins, tied points go to more lines cleared, else a draw. Every screen shows that one result. A member whose host vanished at the last second decides from the logs itself after 6 s (same replay, same answer). - Rematch. In a friend room, the room's waiting screen comes back (the host starts again); against the computer, a new match at the same level.
API: see the header of init.luau. Every word is in locales/<lang>/ladrilho.json under duel.*.