Open j4james opened 5 years ago
This is great. Thanks for doing this. Sorry it's taken me so long to respond here. I did mention it in an announcement on New Years Eve, so it got in under the wire, so to speak.
With luck there will be a 2.26 release, which will fix up a few of the annoying things that came to light last year, and it will include this. It's just that Befunge-93 is not in the priority spotlight right now, so to speak, so when that's gonna happen, I cannot say.
Having read your comments about bridgeit.bf here, I decided to do some digging to see if I could find the BASIC book on which your implementation was based. And while I wasn't successful in that regard, I did come across a Personal Computing article from 1977 which described a winning strategy almost exactly like the one that you were using.
Once I knew how the game was supposed to work, and the strategy used to win, it didn't take that much to get the code working correctly. There were two or three values that were incorrect in the lookup table that determined the computers move. And some of the x coordinates were off by one in the table that determined the board output position. But most of the effort was just getting the board update code to work.
I didn't want to stray too far from your original design, but you really needed to output two different characters (
|
vs-
) for different sections of the board, otherwise the bridges wouldn't make sense. And I also though it would be a good idea to overwrite both digits of the board number, otherwise the output was a bit messy. Unfortunately those two changes added a fair bit of complexity to the code.But once I had the output working for the computer's move, it didn't require that much more effort to output the user moves as well - it was largely just cut and paste. So I thought that was worth adding too, because it really does make the game more playable.
The end result was this:
I realise it's a bit late now, with version 2.25 having been released, but I thought you might appreciate it anyway, even if you don't want to add it back to the examples.