# Omnimaga

## Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: ajorians on March 07, 2013, 06:57:07 pm

Title: Anagramarama
Post by: ajorians on March 07, 2013, 06:57:07 pm
Hey Guys,

I followed the nSDL porting tips (https://github.com/Hoffa/nSDL/wiki/Porting-tips) on a SDL game and would like to show you where I am at!

The game I ported is called Anagramarama (http://www.coralquest.com/anagramarama/).

Here are some screenshots:
(https://dl.dropbox.com/s/3tbdjeyuc09g0hj/anagrama1.gif)

(https://dl.dropbox.com/s/xbitwyf037nijqn/anagrama2.gif)

(https://dl.dropbox.com/s/tforxxjv93437ly/anagrama3.gif)

(https://dl.dropbox.com/s/vm5pxqjno2rd27l/anagrama4.gif)

(https://dl.dropbox.com/s/0born3nne565o7j/anagrama5.gif)

In the zip file download link above; just copy the .tns files in the bin directory to the same folder on your calculator.  Holler if you have any questions/concerns!

To start run nAnagram-sdl; it should start up within a second or two!  Type the letters in the order the word is in and hit [enter] to submit the word.  You can shuffle the available letters by pressing the [space] key!  If the word isn't recognized it remains in the guess area.  If it is recognized it is added to the answers.  But because of the limited screen size on the calculator only 20 answer box areas are drawn.  To clear the guess word press the [del] key.  To see the answers press the [tab] key.  And to get a new puzzle click the [plus] key.  And try to have fun!

To me this was more of a debugging exercise than a programming one!  Various C functions like fscanf, snprintf, strdup, etc had to be replaced since I could only use the function calls listed on this page: http://hackspire.unsads.com/wiki/index.php/Syscalls

It was a fun experience!

I plan on just doing just a tad more with this game.  I plan on fixing a few display issues, add in mouse support (such that you can click to play), and handling for if you don't copy over all files to the same directory.  But give it a try and let me know what you think.  All sources are included such that you can do whatever you'd like with it! :)
Title: Re: Anagramarama
Post by: TheNlightenedOne on March 07, 2013, 07:15:26 pm
Looks very nice! Unfortunately, I'm afraid I don't have enough free space on my Touchpad... I'll probably load it on my CX soon. In all, awesome job! :D
Title: Re: Anagramarama
Post by: Lionel Debroux on March 08, 2013, 02:37:01 am
Looks good, indeed :)

I've spread out the word over at TI-Planet: http://tiplanet.org/forum/viewtopic.php?f=17&t=11371
Title: Re: Anagramarama
Post by: chickendude on March 08, 2013, 06:06:19 am
Very cool! I love these types of games.

And due to the screen size you won't be able to see a lot of the words entered (the longer ones), right? Also, would changing wordlist.txt let us potentially make wordlists for other languages (ignoring diacritic marks)? Or is there more to it than that?
Title: Re: Anagramarama
Post by: DJ Omnimaga on March 08, 2013, 07:20:43 am
Looks very nice and fun to play. :) I assume that despite showing 20 answers at once we can scroll left/right to see more, right? I never played the original so I wasn't sure how it was like. Gonna have to give this a try soon :)
Title: Re: Anagramarama
Post by: ajorians on March 08, 2013, 08:23:19 am
TheNlightenedOne: Thanks!

Lionel Debroux: Awesome!  I have seen the past games I've made show up on TI-Planet and it is wonderful!  Every time I saw them I would sent a link to friends/family!  Thank you for this!

chickendude: Yeah, that is true.  Each word has between 6 and 75 possible words you can make but by showing only 20 the longer ones are omitted.  This does have to change; I'll see if I can adjust it some!  As for making wordlists.txt for other languages (ignoring diacritic marks) I have some good news for you! :)  Take a look at this:
(https://dl.dropbox.com/s/aws1m2cdgaaqurw/anagrama_fr.gif)

The original author added both French and Portuguese!  And so I zipped up their wordlist.txt file and their background image.  So for French download this: https://dl.dropbox.com/s/zq2oah5eftrb6g9/anagrama_fr.zip and Portuguese download this: https://dl.dropbox.com/s/nyaewh46gym9cji/anagrama_pt.zip  To use; extract the zip and transfer the two files over to your calculator replacing the one from the earlier zip file!  When I add the mouse support; there will be a third file that defines where the click regions are! :)

DJ_O: Right now, no, you cannot scroll left/right to see more.  After giving it some thought this morning; I think I should be able to add just a capability without too much trouble!  I'm glad you like it and enjoy playing it! :)
Title: Re: Anagramarama
Post by: chickendude on March 08, 2013, 10:23:36 am
So i just loaded it up and it's pretty cool, the one thing it seems to be missing (apart from the longer words) is a clock! Oh, and thanks for the extra two language packs :)
Title: Re: Anagramarama
Post by: zero44 on March 08, 2013, 01:59:57 pm
Is it supposed to work on non-CX calcs ?
If yes, is there a specific directory in which files should be ?
And could you please edit pictures to make game playable in black/white, because I saw the background on my Clickpad and it seems very ugly and unplayable.

But it seems to be a nice job, continue like this ! I didn't know anything about this game, but dictionnaries seem pretty complete so maths will be less and less annoying (thanks to Ndless ^^ )

PS: my Clickpad is actually crashing, after failed to open the 4 pics.
Title: Re: Anagramarama
Post by: ajorians on March 08, 2013, 03:39:16 pm
chickendude: Sweet!  And regarding the clock; I suppose if you really think that is necessary it could be added in (as it is in the original)!  How about the clock counts UP instead?  It is set to the same amount of time and I'm sure some words are harder to come up with than others!  Plus, I might be slow because the five minutes it is set at isn't enough time for me! :)

zero44: Well, I haven't tried yet on a non-CX calc.  But I now do have an non-CX calc to test with so I'll try to make sure it'll work (and look alright).  It might take a week or so before I can get the next iteration out there!  Hopefully I'll see why your Clickpad is crashing after failing to open the image files.  I do intend on adding error handling code.  Thanks!
Title: Re: Anagramarama
Post by: DJ Omnimaga on March 08, 2013, 11:24:27 pm
One quick and cheap way to check if the game is playable on old Nspire models: Just open the screenshots in an image editor then convert them to grayscale, but decrease the contrast between the white and black a bit :P

Title: Re: Anagramarama
Post by: zero44 on March 09, 2013, 07:06:01 am
I just opened the bmp files with mViewer, I don't know how the boxes are on non-CX.
It said me something like : "failed to open *.bmp : Abort/Continue" and I continued 4 times.
But when you click Abort it's fine.

I think I could port it to z80, compressing dictionnaries to... 100 to 150kb :) (enormous)

EDIT: if it can help you, my calc showed during minutes the turning indicator (thing like a clock) with file explorer in background, keyboard was useless so I pulled a battery out.
Title: Re: Anagramarama
Post by: ajorians on March 13, 2013, 07:38:12 pm
Hi guys,

I updated the program!  You can download it from this post's attachment!  I added the clock (counts up).  Also I made it so all answers are accessible.  To see answers use the left and right parentheses buttons; when you complete a word it will auto-scroll.  I added in some error handling.  I will have to look at mouse stuff; I wasn't satisfied with the initial mouse code (the mouse moved way too slow) so I didn't include that code.  I didn't do all of the graphic fixes I intend on yet.

But it is in a pretty good shape!  The modified source is included, as well as I included a Readme file too!

I tested this on a non-CX calculator and it looks OK to me!  I removed the numberBank.bmp.tns file so it is one less file than the last version.

So enjoy!  Let me know if you guys have any questions or concerns!  I like knowing what you guys think!
Title: Re: Anagramarama
Post by: chickendude on March 13, 2013, 10:05:52 pm
It's much better now that you can see all the words! I finally managed to find all the words, it took me just over 15 minutes, about 8 minutes trying to find the last word (ATOP ;)). I really like the timer as well, it's a nice feature. Do you have any other features you plan to add? I think it's seems pretty complete/ready for release :)

I know it's a port of another game, but one thing i really liked about a lot of these style games was having to get X amount of points within a certain time limit to advance to the next set of letters, kinda like this one here: http://www.wiredarcade.com/game/1772/Word-Ruffle.html
Title: Re: Anagramarama
Post by: Yeong on March 13, 2013, 10:23:51 pm
It looks amazing! I'll try it soon.
Title: Re: Anagramarama
Post by: ajorians on March 14, 2013, 07:22:40 am
chickendude: Awesome!  I'm so glad you solved it!  For what it is worth it makes me so happy to see somebody using something that I had a part of (and liking it)!  I still want to take a small look at the letters that show up in the available letters & guess area.  I re-sized a graphic to get those letters; but I need to do it again (and better) because I see a pink-ish outline on them.  Other than that (and an eventual mouse support) I don't intend on adding to this game.  Which means more fun games!  The mouse support I'd like to get to; but I'll probably start other games beforehand.

You're right that games with achievements, high-score table, etc do add to a game!  Maybe someday I'll add a configuration such that you could make the game easier/harder.  And probably add a high-score table too! :)  Thanks for the link!

Yeong: Thanks buddy!  I really do hope you enjoy it!

Title: Re: Anagramarama
Post by: chickendude on March 14, 2013, 11:14:14 am
I'm excited to hear what your next project will be, this one definitely turned out great :) Any hints as to what it might be?

About mouse support, what do you even need it for? I don't think it's really a priority, especially if that takes time away from your next project!
Title: Re: Anagramarama
Post by: ajorians on March 14, 2013, 03:38:53 pm
Hi chickendude,

Oh I have a long list of games I'd like to make!  And it will take some time to get to many of them!  But the next game I make, I think, will be a single player card game called Tornado 21!  It is on Yahoo games; here is a link to it: http://games.yahoo.com/games/login2?page=t21&ss=1  It is fun to play.

I'll definitely use nSDL as I prefer to do the graphics with that!  I like using C++ (as mentioned in this post: http://blog.tangrs.id.au/?p=712) even though I cannot do some of the features of that language.  I still might use C though.

So mouse support wasn't really needed in this program; but some day (and it will be quite a while) I would like to try making a Settlers of Catan or Ticket to Ride and good mouse interface will make the game a whole lot better!

I like how we share source code because I have learned how some programs do things by taking a look at the source code!

Also, have a great day! :)
Title: Re: Anagramarama
Post by: chickendude on March 14, 2013, 11:56:08 pm
Whoaa some board games would be great! I used to have an old computer game with a collection of different card games: Spades, Hearts, Solitaire, Bridge, Rummy, etc. A card games pack would be fun to have, too :) I've never played Tornado 21 before, though.
Title: Re: Anagramarama
Post by: zero44 on March 16, 2013, 08:00:55 am
Still doesn't work on my Clickpad CAS ... I've around 3Mo left.
Title: Re: Anagramarama
Post by: ajorians on March 19, 2013, 02:09:30 pm
Hi Guys,

I've made a couple of quick updates!  I fixed the letters display issue to my satisfaction and fixed just one bug (starting a new puzzle will return answer page to the beginning).  I'll release it now; so hopefully you'll see it on ticalc soon!  I believe it should be allowed on ticalc even though it wasn't my original code just like nDoom, for instance.  I may come back to it at some point; but I'll get to some new games! :)  The source/binary are attached!

chickendude: If it helps Hearts is my favorite card games and I one day might try writing one! :)  If you've had a chance to try Tornado 21 I hope you enjoyed it!

zero44: Darn!  I did try with a non-CX; but it wasn't a Clickpad CAS.  I will try with one; and I'll have to get back to you with that!  Sorry!

Hope you all have a good day!
Title: Re: Anagramarama
Post by: Keoni29 on March 20, 2013, 11:56:22 am
Nice and colorful. Something you will never be able to say about 84+ games unfortunately (or can you? CSE :D)
Title: Re: Anagramarama
Post by: zero44 on March 21, 2013, 05:03:03 am
Sorry everybody, I put the files in the root directory and it work almost perfectly.
What are the keys to start a new game / scroll answers ?
also I typed [tab] (answer) [a] , the 'a' appeared on the right side, a little too much to the top, and calc crashed when I pressed [clear].

But I'll try the newest version as sonn as possible, probably this afternoon (here in 4 hours)
Title: Re: Anagramarama
Post by: ajorians on March 21, 2013, 07:19:09 am
Hi guys,

Keoni29: I do like how good the color screen looks and it is great that the TI-84+CSE will have a color screen!  But the TI-84+CSE (from my understanding) with its 128KB (21KB user accessible) memory will be the limiting factor!  Someday I might try a compression/decompression algorithm on the word list.  But I don't doubt that there will be lots of nice and colorful programs on the TI-84+CSE!

zero44: I was able to duplicate the crash you mentioned!  Apparently you can type the available letters after pressing the answer key (tab) and then they will be on the right side as you mentioned.  And then pressing the [clear] key does a reboot crash.  Sorry for never noticing it before!  Good find too!  Also, the keys for starting a new game is the plus (+) key; and the parentheses scroll the answers.

Have a good day!
Title: Re: Anagramarama
Post by: zero44 on March 21, 2013, 08:23:55 am
Hi,

Thanks for keys.
I thought to port it to normal z80 calcs, and I found a way to take only 40% of the initial size !!!
But this is only theory, decoding algorithm will be easy to do if we want to check if a word exists, but I don't know how you do know how much words exists for each letter set.
I use the 2/3 firsts letters and the 15 most used letters in the languages, assiociated with custom tokens, to compress this amaaaazing thing. The 15 most used letters (in french ESANTIRULODCPMV, but it may vary) take 4 bits, endOfWord and the others 8 bits.
Title: Re: Anagramarama
Post by: chickendude on March 23, 2013, 11:24:07 pm
With the 8-bit letters you could also have a section at the end for commonly used word pairs/triples, for example in french you could put in all the verb endings (aient, issent, etc.) so that they'd take up just one byte. Looking at it now, though, all those letters could also fit into your 4-bit section. To speed things up and save some space in the dictionary, you could also just use shorter words (maybe 6-7 letters). It's also worth checking out DAWG:
http://www.detachedsolutions.com/dawg/

It claims to have a vocabulary of around 40k words. The app size is around 100kb, not too bad really. Especially for SE users. If we can fit the game into 100kb i say go for it :)
Title: Re: Anagramarama
Post by: zero44 on March 24, 2013, 09:00:10 am
Words ends like aient or issent are very often too long to fit in this game which takes only words from 3 to 7 letters.
But you're right, I could make a 'token' indicating which of these ends are possible : a,ai,as,at,e.

I just need to know now if there's a list of groups of random letters or if they are really random.
Title: Re: Anagramarama
Post by: chickendude on March 25, 2013, 06:16:14 am
What do you mean about a list of groups of random letters?
Title: Re: Anagramarama
Post by: zero44 on March 25, 2013, 03:53:12 pm
I played a lot and it's often the same letters which are randomly displayed, so I already know what are the 7-letters words, and I wonder if the prog takes a random 7-letters word or if some letters set are already preset.
Title: Re: Anagramarama
Post by: chickendude on March 25, 2013, 07:19:08 pm
I assume it picks a 7 letter word and scrambles those letters, i don't think the letters are picked at random.