Post Reply 
(41cx) Mancala Board Game (42s, 35s)
05-07-2016, 07:26 PM
Post: #6
RE: (42s) Mancala Board Game
(05-07-2016 07:37 AM)Dieter Wrote:  After a short look at the code I wonder why some integer constants carry trailing zeroes (e.g. 4.0, 0.0, 6.0 ...). And what about an optimized more effective (shorter and faster) version ?-)

Apologies, brainwashing of a former python programmer. It also helped to fool the parsers. txt2raw.pl, as well as build.sh will sometimes treat the first number on a line as "special". I eventually added auto generated sequence numbers removing the need for this parser hack. Other than making the numbers shorter, I would appreciate any suggestions on changing how I loop to reduce bloat. Of course I could make every variable named and dispense with the indirect access charade, but that would make porting to 35s more error prone. That's why I left that particular piece of bloat in, though it is confusing.

(05-07-2016 07:37 AM)Dieter Wrote:  BTW, I am missing the rules of the game and an example of a session. What's the highest possible score a player can achieve?

Others do a much better job of explaining the game than I do. This is Mancala(US) so that generally means Khala(6,4) in other parts of the world.

The board has four edges, North, South, East, West. Player 1 and Player 2 face each other with the board in the middle. P1 to the south, P2 to the north. Movements are counter clockwise (player moves pieces to the right). The board is laid out with 6 pits on the north, 6 on the south, and a capture pit on the east for P1, and on the west for P2. The game starts with 4 beans in each pit (north and south), and P1 moves first. To move, take all the beans from a pit on your side and "sow" them into the pits to the right. One in each pit wrapping around the board as needed. You are allowed to place a pit in your capture as you wrap around, but are also allowed to skip your opponents capture pit if you have a move that large. You capture beans by wrapping around your pit, and by capturing your opponents. To capture your opponents beans, you need to complete a move where the final pit you move into ends with exactly one seed. The you capture all beans opposite of that pit. First player to 24 wins, though some versions force you to keep playing. Its unlikely to ever win if your opponent reaches 24.

Much better explanations here.
https://en.wikipedia.org/wiki/Mancala

The Kalah page mentiones a mathmatical study of the game my Mark Rawlings that would likely be of more interest, though I can't find where the study was published.
https://en.wikipedia.org/wiki/Kalah

(05-07-2016 07:37 AM)Dieter Wrote:  There is a "HP35s virtual calculator" by HP. AFAIK it comes with the real thing on CD. Since I already bought my 35s in 2007 (with the printed manual, but without a CD) I downloaded the emulator some years ago from the HP website.

OK... so I checked the CD that came with it last month... Nothing but PDFs. Turns out reading a CD is harder than I thought. Don't have one in any of my primary machines anymore. Found an old Vista laptop for the task eventually. I found another article mentioning that the SW is available with proof-of-purchase, but didn't find where to get it. Contacted support and they agreed, but hung up before they could send me the link.

I did eventually find an "Educators" page where you can request teaching material (including emulators), but I don't know that I qualify. I sent my syllabus / lesson-plan for the computer class I teach, but it's not really in the same realm as Calculus III. Might be interesting to add a section on low-level programming. The RPN 'language' has some similarities to assembler and microcode that would be fun to present.

(05-07-2016 07:37 AM)Dieter Wrote:  I am not sure what exactly you are looking for. You know hp41uc, don't you? It's here (and possibly a newer version somewhere else). I use it here and there with the V41 emulator to generate program listings, but it can do much more.

I'm looking for something that will convert:
Code:
LBL "HHGTTG"
42
RTN
... into something that can be executed on some 41c emulator/simulator. Basically a way to take a text file of instructions and see if it would likely execute on a 41 as expected.

Looks like hp41uc.exe does TXT to RAW and looks like V41R8.exe can import and execute RAW files. So these two should work for me. Didn't find them earlier, so thanks for the suggestions.

MyCalcs: Physical: {hp48gx, hp50g, hp35s} Emu: {hp42s(Free42), hp41c(v41)}
Blog: https://brianddk.github.io/
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (42s) Mancala Board Game - brianddk - 05-05-2016, 11:23 PM
RE: (42s) Mancala Board Game - Dieter - 05-06-2016, 09:51 PM
RE: (42s) Mancala Board Game - brianddk - 05-06-2016, 10:45 PM
RE: (42s) Mancala Board Game - Dieter - 05-07-2016, 07:37 AM
RE: (42s) Mancala Board Game - brianddk - 05-07-2016 07:26 PM
RE: (42s) Mancala Board Game - brianddk - 05-07-2016, 08:50 PM
RE: (42s) Mancala Board Game - brianddk - 05-08-2016, 05:44 AM
RE: (42s) Mancala Board Game - Dieter - 05-09-2016, 08:11 AM
RE: (42s) Mancala Board Game - brianddk - 05-09-2016, 01:38 PM
RE: (42s) Mancala Board Game - brianddk - 05-09-2016, 11:12 AM
RE: (41cx) Mancala Board Game - brianddk - 05-10-2016, 01:27 PM
RE: (41cx) Mancala Board Game - Dieter - 05-10-2016, 06:43 PM
RE: (41cx) Mancala Board Game - brianddk - 05-10-2016, 07:19 PM
RE: (41cx) Mancala Board Game - Dieter - 05-10-2016, 08:43 PM
RE: (41cx) Mancala Board Game - brianddk - 05-10-2016, 09:22 PM



User(s) browsing this thread: 1 Guest(s)