Projects » Abstract Strategy Board Games
Not Finished
Description
Our games page is already quite long, but it could be better. Lets program some board games
For anyone who is interested, there are several games that could be programmed. We would need to do them one at a time, posting code, optimising it, changing it, and then publishing it on the games page. here are some examples-
1. peg solitare
2. Go
3. Isola (Isolation)
4. Mancala
… there are many possible others. If you're interested in participating in this community project, please post about your interest and which game you'd like to start on first, so we can get started. In publication on the games page, credit will be given to the original contributor(s) of the code, and to those who helped optimise it. If there are many small optimisations, credits for the optimisations will be given to the Ti-Community, with a link to this page for clarification.
Updates
Who Updated? | Date | Update |
---|---|---|
TI-GBR | 22 Oct 2015 14:11 | It seems that we are ready to make a mancala page. once it is made, feel free to edit it to relative perfection. Both games will be published, And credit given to those who worked on this community project. THANK YOU to all those who participated. we are starting a new ABSTRACT STRATEGY BOARD GAMES project featuring Isola. Please come participate in this continuation of this page, if you want to. |
TI-GBR | 20 Oct 2015 19:03 | We have optimised the two games to a good point. They both work. the next step is to publish them on a new page titled "Mancala" under the games page. |
TI-GBR | 16 Oct 2015 14:19 |
Since there are so many rules to this game, we are developing two mancala games. Both need to be optimised for size and speed though! If you are good at optimisation, please come help us. Also, If you are interested in Helping us program a different board game please post about it, and we can move on to that one after mancala is finished. As far as I can tell, we only have a few participants in this project at the moment. ||
Discussion
This has been showing error messages. Can someone fix it?
Make sure R is greater than 0 and less than 7.
P probably isn't 1 or 2, which is probably giving you the error.
What error are you receiving? Any of these?
Hewwo, my name is Achak Claw. I was formerly BioHazard.
Anyone have a working V2 of Mancala?
Hmm, this does seem glitched…will look at it! Thanks for bringing it to attention :D
Please keep me posted on if it works
I've been working on a somewhat related game, even though I knew nothing about this thread. Has anyone heard of Othello? It is also known as reversi. A version of it was just recently made available for download on the Nintendo Switch, but it has been around for a long time. I'm having some trouble with some of the routines, but I am working on it!
You should tell us when u r done
It has been done for quite some time!
:)
What do you use to select the pieces to move
Use [ENTER] to select and the arrow keys to move the cursor.
EDIT: Also see the alternate mancala here
That doesn't work tho
[2nd] to select a number, plus the left and right arrow keys to navigate, assuming you are using the Kahla rules version of Mancala. [CLEAR] to quit
For version two, use [ENTER] to select a number plus the up and down arrow keys to navigate (Version two won't support exiting).
Also make sure everything is typed in correctly :)
I did that and checked everything and pressed enter and it's really anticlimatic nothing happens. I hate to do this to u, but if yours works can you type it here please preferably a working Version 2. Thanks
The K1 for me doesn't work and complains of a matrix error
Put a semicolon in between the K and 1. Do this in general for Delvar commands.
I'll see if I can get an Admin to fix that :P
EDIT: I meant a colon ":"
I am going to post my version of Mancala here. This is NOT intended to be a replacement for the other mancala game by kg583, rather, it is simply another rule set, the one that I was taught. Please continue to optimise kg583's code if at all possible. We will publish both games on the mancala page, so the user can choose his/her rule set. Please see what can be optimised here, too. *arm wave to other members of the site* (it would be nice to have a better participation rate)
My rules are:
board 6 by 2 active houses with 4 stones starting in each, and two wells, one at either end.
Picture at start(Its been stretched a little)
Each player, on their turn, chooses a house on their side of the board. (6 options)
After first turn: player 1 has chosen the fourth house from the top, the last stone fell in a well, so player 1 will go again.the stones from that house get distributed by picking them up, and placing 1 stone in each house consecutive to the last, going around in a counter-clockwise pattern until the stones run out. If the last stone falls in one of the wells, then the player gets another turn. The first player to clear their side of the board of stones wins.
Player 1 goes again.
Now its player 2's turn.
End of game image:
Player 2 has won.
Here's the code: I does need optimisation. Be careful of the difference between L1 and the letter L
Vars used:
List 1 schematic in relation to position of list elements on the screen.
I'd rather do Repeat not(S A while loop would run the loop one more time than necessary due to program structure , and I put SetupEditor because It always messes my editor up.
I will try the code with a while. It works! All right.Changing that, and adding a conditional to the input repeat routine to stop someone from choosing an empty house.
Changed that, too.
Some other optimizations:
1.
can be
2.
can be
3. If there are any parentheses or quotations at the end of a line or before a —> function, it saves bytes to remove them
4. I noticed that, like my code, your code uses the number 14 a lot. Because of its frequency, it saves bytes to declare a variable as 14 and reference the variable (one digit vs. two)
The solution to a complex problem is often a simple answer.
Ok. give me a sec and I'll update.
I have Implemented most of the changes
I usually prefer to use
because it is a compromise between both, and takes less space than adding Ans->K afterwards.
P.S. The general convention is to use -> for the STO arrow instead of —>. Also, does not equal is != not =!.
Did that instead. Thats better.
The reason =! is used to mean "not equal to" here is because the correct way:
says 5! (5 factorial = 120). I know that != is the convention in other programming languages but in this scenario there can be confusion. Also, it really doesn't matter if use one dash or two for STO. I'm just used to using two.
The solution to a complex problem is often a simple answer.
These things actually do matter if you are using an tokenizer such as SourceCoder which converts text into the tokenized format. 5!=6 is interpreted as 5≠6, 5!!=6 is interpreted as 5!≠6. I don't think any reasonable person would be confused by these things. If everybody is using different conventions, it leads to more confusion.
If you want to be more specific, you can use the backslash (\) to escape tokens:
I Like it! I didn't know that Delvar had an implied colon after it. Now I do…
Ok. So you have a K1 variable in the coding and my error message says wrong value or variable type entered. Help
Made in about an hour:
Total Size (atm): 843 Bytes
Compatibility: Color and Grayscale
Variables Used: A,B,C,D,J,P,Q,X,L1,L2,L3
Please feel free to leave ANY optimization suggestions! I'm quite certain this can still save some bytes.
Cheers!
The solution to a complex problem is often a simple answer.
Well! This brings up a good point! There are LOTS of mancala Boards and as many rule sets. I,too made a mancala game, which is smaller, but has fewer features, which I will post for optimisation, yet it is unique to this game. We can post both games on the mancala page (does not exist yet), after optimising them. This is great! Now I will focus on optimisation…
Please explain this version of the rules of mancala in detail.
Apart from the 1 thing I changed, I can't find much else. 2 big optimisation suggestions:
1. Restructure to use a repeat loop instead of a LBL loop. this is a lot of work for not much benefit since the only mem leak is if you keep selecting an empty house. So, this suggestion is NOT necessary.
2. Use only one list that loops back on its self during the distribution of stones process. this would shorten the code, the impact on data, and the vars used.
Good point! kg583, where should the getkey go?
This version of Mancala is called "Kalah" and is the ruleset most often used for sets in the United States. Basically, each player gets a turn to move all stones in a house counter-clockwise. Landing the last stone in the store gets an extra turn, while landing in an empty house will reward the player with the stones of the opposite house plus his own last stone.
I can edit the code (beyond the optimizations you suggested) to allow for different board sizes or stones per house. But other rules might be hard to add here.
The solution to a complex problem is often a simple answer.
Yes, I agree. I wasn't saying you should add other rules, I was saying that we can post both yours and my mancala games, which run by different rules. that way someone can choose which rules they want and use the appropriate game.
If you want to al;low for different boards, sure. But your code does seem pretty good as it is.
You might try implementing the Pie rule to remove the 1st player advantage.
Saved about 80 bytes by making everything in one list:
I couldn't get the board change to work on grayscale dimensions. Also, in terms of the Pie Rule, it would be just as easy to have the players swap turns instead of extra code to do that.
The solution to a complex problem is often a simple answer.
Point taken. How do you not use getkey?
SHOOT! I TOTALLY FORGOT THAT! Just fixed it.
The solution to a complex problem is often a simple answer.
A small tip: sum( has optional arguments. So not(sum(seq(L1(L),L,1,6 can be not(sum(L1,1,6.
You have a typo Here:
that last line…
Also, put a : between two commands on the same line
Both your corrections aren't necessary. The last line of the first "typo" is completely correct because you can subtract different values from different list elements so long as the two lists have the same dimensions. Also, DelVar has the special ability to eliminate the need to put the next bit of code on a new line.
Example:
can be
The solution to a complex problem is often a simple answer.
I just tested this on my '83 and I got a domain error. I tried switching the two possible values for L2, but still got a domain error. the error occurs on the first For( loop.
That is…weird. I made the code on my CSE but I mapped out the dimensions to work on an '84 or lower. Have you done any specific bug testing for that error yet?
The solution to a complex problem is often a simple answer.
Sorry, I mistyped a few lines…
Ok, I have actually tested it, It seems to work, with these two bugs
1. If the number that Is being selected is greater than nine, the cursor erases the ones digit when it passes over.
You could fix this by having the cursor above or under the rows and using "v" and"^" ( small v and power symbols)
2. The Program does not clear the area of the end houses before displaying them.
To fix this bug, put these two commands before the above commands.
Other than that, I don't understand the rules further than the basic mancala distribution and the scoring, but I know that's just me, and it has no effect on the quality of this game. Usually, It takes someone showing me a rule set for me to understand.
But aside from those two things, It seems to work. I think I figured it out now, more or less. Good Programming! If you think its good enough as it is we can go ahead and publish the two games, and close this part of the project down.
well, anyhow I added those two commands in when I made the Mancala page. If you want to change anything, go ahead.
I'm not sure if this counts as a board game or not, but I came up with a short little program a while ago that could be added.
It's called Block Run; I made it when I first learned getKey and how to use Matrix-based collision detection.
The player is a block that is constantly moving around on the homescreen. His goal: eat the star. Every time he eats a star, a new star, along with a new wall, appear randomly on screen. The player continues until he runs into a wall or the edge of the screen. I have since added modes that put a bumper on the edge, cause walls to spawn constantly, and have walls spawn in patterns. I'm not sure if I should submit it or not; if it is acceptable though, I'm happy to put in my code.
I hope I don't sound like I'm advertising my game or anything; I just want a bit of feedback. Cheers!
The solution to a complex problem is often a simple answer.
Sure! this would be Just fine, as long as you think the code could be optimised down to the size that is reasonable for a program on the experiment games page. The games page is not so much for large, high quality games, as for small, functional games that illustrate what can be done with this language. Although Block run was not exactly what I had in mind, Its not too far off. If You want to do this as one of these games, go ahead and post the code, we'll optimise it, then we can publish it to the games page, giving you credit, of course.
But in general, I was thinking we should do ancient games that have simple rules- "easy to learn, difficult to master"- chess is like this, though a chess game has already been made, and I think its a little too complex for this project.
Thanks for the feedback. I'll post my code as soon as I can.
I definitely agree with your idea of "simple but hard to master" games; simplistic games are often the most enjoyable.
Some other possible games (sorry if these just sound like Hasbro games):
Backgammon
Checkers
Battleship
Dominoes of some kind
Tic Tac Toe
The solution to a complex problem is often a simple answer.
Good suggestions!
But, lets choose a game and finish it, one at a time.
For anyone who is interested, there are several games that could be programmed. We would need to do them one at a time, posting code, optimising it, changing it, and then publishing it on the games page. here are some examples-
1. peg solitare
2. Go
3. Isola (isolation)
4. Mancala
… there are many possible others. If you're interested in participating in this community project, please post about your interest and which game you'd like to start on first, so we can get started. In publication on the games page, credit will be given to the original contributor(s) of the code, and to those who helped optimise it. If there are many small optimisations, credits for the optimisations will be given to the Ti-Community, with a link to this page for clarification.
Also, unlike the other projects, lets finish this one. We can do this by setting reasonable goals, then we can decide to stop or continue. So, who wants to do this?
Sounds like a good idea. I could work on Mancala probably, but please know that I am terrible at optimizing and making things look pretty. Also, do you plan on doing this in raw TI-BASIC?
The solution to a complex problem is often a simple answer.
Yes, all games should be in ti- basic, preferably compatible down to an 83, and you can post code, others can optimise it. Just don't use lbl and goto much, that makes it hard to optimise. We can tweak graphics, too.
Often, the homescreen is just fine for these simple games.
Edit: see below for clarification about lbl 's and goto's
Also, you don't have to come up with a whole game. you can create routines to be a part of the game..
example: Routine for setup
Routine to check for a win, etc.
but we all need to be on the same page, so lets see who else wants to participate, and we can collaborate on a game. We should do one or two at a time so they get finished.
Does that mean we can't do TI-Basic Color games? :(
Ok, why not?, but lets do it so that you can add a little code here, delete a little there, and its compatible with the older ones, too. We just need to specify what code is what. The calcs are Mostly backwards compatible, you just need to change a few vars or commands. Most people own the originals, so code that was purely colour compatible would not get used much. Still, there are few games for the colour calcs, so it would be good to make programs color compatible. No assembly though, except for cosmetics like lower-case, etc. that are not necessary.
A routine for color detection is Here. we can use that to set vars beforehand.
Or, better yet, in the code just say, "replace :code with :code if you have a color calculator", or "add a fifth ',5'argument if you have a color calculator." or
That's true, just often there are several ways to do a program, and if you use Lbl 's and goto 's where you could use loops, the code ends up being a lot longer, usually has a mem leak, and the game has to be redesigned to optimise it. That surely doesn't mean that those commands don't have their place and use. Just its really hard to optimise code that uses an excessive amount of those commands where a loop could be used.
This is only true with improper use of Goto and Lbl. Proper usage can actually make a program shorter and faster by removing redundant code blocks, or allowing the program to jump to specific places without a complex and possibly inefficient loop structure. I think people automatically discount the value of goto commands because they can be easily misused, which can create more problems. If TI-BASIC supported functions or methods, then labels wouldn't be necessary and probably wouldn't be part of the language.
It might also be advisable to create a new thread for each new game, because the discussion about what games to make has become buried in the discussion about mancala.
As to your first point, I realize that Lbl and goto may have efficient uses, I just have never seen it. People have had this discussion before though. It would be a good Idea to add an article with the proper use of lbl and goto, if it hasn't been created already. The goto page is rather biased.
Second point. I can consider it, But let me tell you my reasoning first. We would do one game at a time, then whenever we finished one game, we could bring up the question of if we want to continue, And if so, what game to do next. Perhaps this is inefficient? Please tell me what you think. I thought that creating a new project for each game would mess up the projects page, and would split up participation in the project.
This discussion was at the cutting edge of computer science in the late 60's and early 70's.
Edsger Dijkstra wrote a famous paper in 1968, GOTO considered harmful, which was basically the beginning of "structured programming". If you can imagine, getting rid of GOTO statements and using loops instead was a radical idea at the time that encountered a lot of resistance. Donald Knuth wrote Structured Programming with goto Statements in 1974, where he analyzes how there still are some cases where using goto is more efficient and easier to understand than using control structures. Check it out if you're curious to see examples of what proper goto usage can look like.
In case these names are not yet familiar to you, Dijkstra invented the stack to implement recursive functions, and Knuth wrote The Art of Computer Programming, among many other things.
(I triggered the Google foobar challenge searching "goto considered harmful")
The other way to look at it is that it took a decade of programming with FORTRAN, COBOL, and ALGOL (which were all closer to Ti-Basic than not) for the field to realize this was a big deal.
I've got past the Level 1 so far of the foobar challenge, we'll see how far I can make it.
From scanning the Wikipedia page on it, Go will be nontrivial to implement—determining if a group has been captured (let's say Black has just played) will require one flood-fill algorithm to find all groups with a stone next to the last move, and then a checking of each group for liberties.
The ko rule would require a storage of the last board position to check if the position is identical. Unless there's a clever way to do it, we can't hope to implement superko rules, becuase then we'd need to store many past board positions.
that's fine, right now, though we're working on mancala :)
Here is my version of isola. I need your help to optimize it, i'm just starting coding.
I hope i'm writing in the right place.
Sorry for the bad quality of my English, i'm french.
It takes ~730 bytes
If you have any question, ask me.
why don't we make a new project page for Isola. Its not wrong to do it here, Just this whole page turned out to be dedicated to Mancala, and people wouldn't see the section on Isola. You would be able to to a lot more on this site if you make an account. I'll make a new page for Isola, and post the code above as the first post, and put your name on it. I'm sure we can optimise it.
Okay, I made the page. It is before this page on the projects page. Lets continue this Project there.