The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

Pyramid 89

Started by Ranman, November 11, 2017, 03:46:28 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranman

November 11, 2017, 03:46:28 pm Last Edit: November 20, 2017, 06:54:34 pm by Ranman
Last week I dusted off one of my old projects that I created for one of my graduate courses that I never submitted.

The game is called Pyramid Solitaire. It is a simple fast paced solitaire game. See attached screenies.

Edit... This is another game that I thought I had lost back when my hard drive crashed and lost my backup. So... I have to make a few tweaks and rewrite the readme file (since it was not on my backup drive). Then i'll get it released too.

The object of the game is to remove all cards from the pyramid by matching 2 cards that add up to a value of 13 (kings are 13 all by themselves). You get to cycle through the deal pile a limited number of times to assist with finding cards.

Edit #2: Attached pyramid89.zip.
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

DJ Omnimaga

This looks very good Ranman. Glad to see you found another of your old projects again. I myself thought I had lost some back in the days, only to find them out on a DVD-R half a decade later.

Lionel Debroux

Looks good indeed, another good find on your formerly lost backup drive :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Ranman

Quote from: xlibman on November 13, 2017, 07:05:37 pm
This looks very good Ranman. Glad to see you found another of your old projects again. I myself thought I had lost some back in the days, only to find them out on a DVD-R half a decade later.


Quote from: Lionel Debroux
Looks good indeed, another good find on your formerly lost backup drive :)


Thanks guys!!
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

Ranman

November 20, 2017, 02:24:24 pm #4 Last Edit: November 20, 2017, 11:10:00 pm by Ranman
Pyramid Solitaire was uploaded to Ticalc today.  :w00t:

Edit: attachment moved to first post.
Ranman
Bringing Randy Glover's Jumpman to the TI-89 calculator. Download available at Ticalc.

DJ Omnimaga

Good to see it released! You should put the link in the first post if not done already. :)

Lionel Debroux

December 01, 2017, 04:47:17 pm #6 Last Edit: December 01, 2017, 04:50:15 pm by Lionel Debroux
Several suggestions about the code:
  • the ZIP file is incomplete ;)
    The three missing assembly files can be found in the Jumpman ZIP (and should be using the versions for which I suggested optimizations in the other thread, I haven't downloaded the latest Jumpman version to check).

  • conversely, the Pyramid Solitaire ZIP might be cleaned up, as some functions don't seem to be used;

  • in TimeUtils.c, Sleep(): the "/ 2.65" causes a conversion to float, a floating-point division, and a conversion back to integer. "* 100 / 265" is more efficient size-wise (that's what matters) and speed-wise;

  • in pyramid.c:
    • I noticed that depending on how the linker reorders section, the call to SetUserFont(intvfont - 32 * 8, ...) (clever way to save space, I like it in general :) ) can end up producing a reference to outside the program's space, and the linker produces an error in such a case. As long as you don't hit the issue, it doesn't matter much.

    • careful ordering of the functions in pyramid.c (I can provide you the file if you're interested) makes it possible to declare the functions "static", which avoids the need to use prototype declarations at the beginning, and most of all, opens the set of functions to inlining - usually beneficial to code size for functions called only once, or trivial functions such as ResetAutoQuit();

    • in MoveCursor(), you're using floats for the usual Pythagorean distance computation; isn't there a way you could use squared distances, avoiding sqrt and floats altogether ? ;)

    • is there a way to reach value == 26 in CheckSelection() ? Normally, kings are selected as single cards. The point is, if value == 26 can't occur, then you can use value == 13 instead of (value % 13) == 0... avoiding a division and opening the function to inlining.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Powered by EzPortal