Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
Hey,

I was wondering if you guys would like to see this set of puzzles ported to the TI 84 CSE: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/

There is full documentation about how the apis in the code work: http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/

Also, is this even possible?
Yeah, it's possible , but each one would require a lot of work. I recommend you attack one or two of these rather than the entire page, cause you will be coding for decades. If you wanna do this, I recommend at least doing it in hybrid basic, which will make graphics a lot easier (displaying sprites, rectangles, etc) and faster. Some of these have already been made for the CE in C I believe, so you could get inspired from that code, and some of them have already been made for the CSE in hybrid basic such as Minesweeper, Bridges, Mastermind...
Edit: Also the thing they call same game.
How would I get started with this?
smileytechguy wrote:
How would I get started with this?

It would help if you specified what exactly you're having trouble with. If it is indeed getting started, then I would recommend first planning the user interface, then implementing it.
After that you could plan and implement the game logic.
Well, if I were the one who wanted to do this, here is how I would attack the program:
    1) Pick a game
    2) Make sure I can think of a way to make all the mechanics work (you don't want to code for a few days and then run into a really big problem you can't solve)
    3) Build the game, starting with the actual game code, then working on sprites, then a nice UI, then random optimizations and bugfixing
Lets apply it to an actual game and make a sort of walkthrough of how I would approach it:
    1) Lets pick Pegs because to the best of my knowledge, it hasn't been made yet and looks very doable.
    2) I will need a matrix with 1s, 2s and 0s (1 for empty circle, 0 for filled circle and 2 for out of bounds). Next, I will need cursor (like an inverted empty rectangle) to move around, and clicking once will make the rectangle stay, then I will check where where the 2nd click is, if it is on a 1, then check if it is 2 positions away in the X or Y axis, if it is, then check if the cell in the middle is a 0, if it is, allow the move by setting the middle to 1, setting the initial to 1 and setting the 2nd click position to 0. If the 2nd position is either a 0 or a 2, immediately discard the move. After each 2nd click, refresh the screen with the possibly modified matrix.
    3) Start coding it, starting by making a 7x7 matrix with a cross pattern, then making a getkey routine with the little checking stuff I said above, maybe do something by drawing on the 2 buffers and switching between the two to make things more seamless. In this case, we don't even need sprites, we can just draw circles. Then, make a little custom menu routine, and save the matrices for different levels (Here is a nice place to get creative by thinking of efficient ways to store your levels)
    And now we have a game Razz

Now I kinda want to do this, sounds like a fun 1 day project type of program Rolling Eyes
mr womp womp wrote:
Well, if I were the one who wanted to do this, here is how I would attack the program:
    1) Pick a game
    2) Make sure I can think of a way to make all the mechanics work (you don't want to code for a few days and then run into a really big problem you can't solve)
    3) Build the game, starting with the actual game code, then working on sprites, then a nice UI, then random optimizations and bugfixing
Lets apply it to an actual game and make a sort of walkthrough of how I would approach it:
    1) Lets pick Pegs because to the best of my knowledge, it hasn't been made yet and looks very doable.
    2) I will need a matrix with 1s, 2s and 0s (1 for empty circle, 0 for filled circle and 2 for out of bounds). Next, I will need cursor (like an inverted empty rectangle) to move around, and clicking once will make the rectangle stay, then I will check where where the 2nd click is, if it is on a 1, then check if it is 2 positions away in the X or Y axis, if it is, then check if the cell in the middle is a 0, if it is, allow the move by setting the middle to 1, setting the initial to 1 and setting the 2nd click position to 0. If the 2nd position is either a 0 or a 2, immediately discard the move. After each 2nd click, refresh the screen with the possibly modified matrix.
    3) Start coding it, starting by making a 7x7 matrix with a cross pattern, then making a getkey routine with the little checking stuff I said above, maybe do something by drawing on the 2 buffers and switching between the two to make things more seamless. In this case, we don't even need sprites, we can just draw circles. Then, make a little custom menu routine, and save the matrices for different levels (Here is a nice place to get creative by thinking of efficient ways to store your levels)
    And now we have a game Razz

Now I kinda want to do this, sounds like a fun 1 day project type of program Rolling Eyes


I would do it, if you hadn't spoiled the fun by telling us how to do it Mad Just Joking
Kay, it's been a few hours, I've made the game... I have a problem D:
Here is my code, currently, it kinda works, but playing with it a little, you will see that it actually has a very major bug that I haven't yet fixed. I've procrastinated the fixing of that bug by working on other things like the icon and adding the DoorsCSE detection code. I still need to add the main menu where I plan to add other maps, and possibly store them in a better way than just the plain matrix, although it's only like 49 elements, which isn't too bad.
EDIT: Added the main menu, a different level, and fixed the critical bug, its was a stupid mistake (I forgot to close a parenthesis when I had to)
Code:
:DCS
"0000001111000000000011111111000000011111111110000011188888811100011188888888111001188889988881101118889999888111111889999998811111188999999881111118889999888111011888899888811001118888888811100011188888811100000111111111100000001111111100000000001111000000
If 80>det([[20
Then
   Disp "G[|e][t] Doo[r][s] CSE [t]o [r]|u[n] [t]hi[s]:","h[t][t][p]://[|d][|c][s].[|c][|e]m[|e][t][|e][|c]h.[n][|e][t]
   Return
End
real(0,1,1
real(8,1,0
real(0,3,4,149
"Pegs CSE
real(6,0,45,4,28
"Cross/Octagon/7x7/8x8/Quit
real(6,0,32,34,28,47
1->F
Repeat max(K={21,105,45
   ">
   real(6,0,24,26+8F,8
   Repeat K
      getKey->K
   End
   ">
   If max(K={25,34
   real(6,0,24,26+8F,149
   F+(K=34)-(K=25->F
   F-5(F=6)+5not(F->F
End
If K=45 or F=5
Return
If F=1
Then
   [[2,2,0,0,0,2,2][2,2,0,0,0,2,2][0,0,0,0,0,0,0][0,0,0,1,0,0,0][0,0,0,0,0,0,0][2,2,0,0,0,2,2][2,2,0,0,0,2,2]]->[A]
   32->E
End
If F=2
Then
   [[2,2,0,0,0,2,2][2,0,0,0,0,0,2][0,0,0,0,0,0,0][0,0,0,0,0,0,0][0,0,0,0,0,0,0][2,0,0,0,0,0,2][2,2,0,0,1,2,2]]->[A]
   36->E
End
If F=3
Then
   DelVar [A]:{7,7->dim([A]
   1->[A](1,1
   48->E
End
If F=4
Then
   DelVar [A]:{8,8->dim([A]
   1->[A](1,1
   63->E
End
real(8,1,0
real(0,3,4,223
"P[|e]g[s] CSE
real(6,0,45,4,21
For(A,1,7+(F=4
   For(B,1,7+(F=4
      [A](A,B)->C
      If C=1 or not(C
      Then
         real(7,9,25+12A,10+12B,12,12,255
         real(7,12,31+12A,16+12B,4,26+123C
      End
End:End
DelVar K4->A:4->B
{0,0->L1
While E!=1
   real(7,8,26+12A,11+12B,11,11
   Repeat dim(L1)=6 or K=45
      Repeat K
         getKey->K
      End
      If K!=21
      Then
         real(7,8,26+12A,11+12B,11,11
         Else
         augment(L1,{A,B->L1
      End
      If K=24 and A>1
      A-([A](A-1,B)!=2->A
      If K=26 and A<(7+(F=4)
      A+([A](A+1,B)!=2->A
      If K=25 and B>1
      B-([A](A,B-1)!=2->B
      If K=34 and B<(7+(F=4
      B+([A](A,B+1)!=2->B
      real(7,8,26+12A,11+12B,11,11
   End
   If K=45
   Return
   If abs(L1(6)-L1(4))=2 xor abs(L1(5)-L1(3))=2
   Then
      A->C:B->D
      If L1(6)!=L1(4)
      Then
         max(L1(6),L1(4)
         Ans-1->D
         Else
         max(L1(5),L1(3)
         Ans-1->C
      End
      
      If not([A](C,D)) and not([A](L1(3),L1(4))) and 1=[A](L1(5),L1(6
      Then
         E-1->E
         real(7,12,31+12C,16+12D,4,149
         1->[A](C,D
         real(7,12,31+12L1(3),16+12L1(4),4,149
         1->[A](L1(3),L1(4
         real(7,12,31+12A,16+12B,4,26
         0->[A](A,B
      End
   End
   real(7,8,26+12L1(3),11+12L1(4),11,11
   2->dim(L1
End
Pause
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement