MAID 4096th
Previous bread: >>106275813
Last week, I decided to make a 2048 clone in Forth because why not. Asked if it was /gedg/ or /dpt/ and was advised to create my own MAID themed thread. I still have no idea what this has to do with maids. Apparently it sparked some maid threads over the week, but I'm still not sure there are enough maidposters to keep it alive 247. Maybe something like "Mondaily Maid Thread" or something similar could work out better? Idk.
Anyway, I fixed fall ( sentinel a1 b1 c1 d1 -- sentinel a2 b2 c2 d2 ) by adding sentinel values and following the algorithm described at >>106277717 . It does work, I don't know why I got confused in the end and stopped. I was very sleepy, I guess. Had to add a lot more words to manipulate the sentinel, and could probably refactor it into something more readable, but I already struggled to make it work, I'll make it nice later. I also don't know why I went nuts overfalling>. I could
I also went down the rand() rabbit hole because Forth didn't have it natively. Turns out it's a very simple func. There's also something wrong with the addRandomVal ( -- ), because it was leaving something on the stack. Instead of going over it to fix, I just added a drop and now the game is "playable". There are no checks for victory or loss, it just divides by zero when you fill the board (on random % emptySpaces), but you can have some fun. The major problem right now is that it's really hard to tell the numbers apart at a glance, so I'll change drawGrid to add color escape sequences and such. It'll be hardcoded, maybe later I could integrate it with curses from C libraries for portability, but I don't care right now. Then I'll need to fix the addRandomVal (sometimes it also just don't add anything (or overwrites a 2, idk).
Last week, I decided to make a 2048 clone in Forth because why not. Asked if it was /gedg/ or /dpt/ and was advised to create my own MAID themed thread. I still have no idea what this has to do with maids. Apparently it sparked some maid threads over the week, but I'm still not sure there are enough maidposters to keep it alive 247. Maybe something like "Mondaily Maid Thread" or something similar could work out better? Idk.
Anyway, I fixed fall ( sentinel a1 b1 c1 d1 -- sentinel a2 b2 c2 d2 ) by adding sentinel values and following the algorithm described at >>106277717 . It does work, I don't know why I got confused in the end and stopped. I was very sleepy, I guess. Had to add a lot more words to manipulate the sentinel, and could probably refactor it into something more readable, but I already struggled to make it work, I'll make it nice later. I also don't know why I went nuts over
I also went down the rand() rabbit hole because Forth didn't have it natively. Turns out it's a very simple func. There's also something wrong with the addRandomVal ( -- ), because it was leaving something on the stack. Instead of going over it to fix, I just added a drop and now the game is "playable". There are no checks for victory or loss, it just divides by zero when you fill the board (on random % emptySpaces), but you can have some fun. The major problem right now is that it's really hard to tell the numbers apart at a glance, so I'll change drawGrid to add color escape sequences and such. It'll be hardcoded, maybe later I could integrate it with curses from C libraries for portability, but I don't care right now. Then I'll need to fix the addRandomVal (sometimes it also just don't add anything (or overwrites a 2, idk).