Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: ExtendeD on April 17, 2011, 10:23:27 am

Title: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: ExtendeD on April 17, 2011, 10:23:27 am
Here is a simple Minesweeper in Lua. It's not very well-coded since I learnt Lua yesterday, and doesn't look so good since I am not good at game design, but it's a first shot that I may try to improve later. It's untested on real calculator, and not thoroughly tested.

It will at least give another example of Lua code for beginners. TI's event-driven API  is nice and easy to use. Thank to all of those who contributed to bring Lua development to the TI-Nspire :)

Keys:
- R: restart
- Enter: dig
- F: set/unset flag/unknown

TODO:
- Make it compatible with the Touchpad mouse?
- Use colors for the CX
- Check if the game is won
- Display the keys
- Show when the game is over
- Use images
- Simplify code
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Munchor on April 17, 2011, 10:24:25 am
Looking good ExtendeD, since I can't try it, I'd like an animated GIF of it :D

Great to see so many Lua games coming out already :D
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Adriweb on April 17, 2011, 10:24:54 am
Really nice ! :o

Congratulations on coding this as your second day of Lua :P
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Lionel Debroux on April 17, 2011, 10:38:47 am
"9sweeper"... once again, you're making an excellent choice for the name of one of your programs ;)
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: apcalc on April 17, 2011, 10:39:53 am
Very nice ExtendeD!  I will be sure to try this out! :D
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: GB on April 17, 2011, 02:56:49 pm
I just wish there was some way to get Lua to work in 2.0...
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: DJ Omnimaga on April 19, 2011, 02:56:03 pm
I didn't comment yet because I didn't have time but this is really great. I tried it and the speed seems nice too. Good job. :)

You should put it in http://www.omnimaga.org/index.php?action=downloads;cat=45 with Block Dude and ticalc.org, though. Ticalc actually added a Lua section :D
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Munchor on April 19, 2011, 02:58:17 pm
I didn't comment yet because I didn't have time but this is really great. I tried it and the speed seems nice too. Good job. :)

You should put it in http://www.omnimaga.org/index.php?action=downloads;cat=45 with Block Dude and ticalc.org, though. Ticalc actually added a Lua section :D

They also made a news thread (after a long time without one). Hope this will make more people start coding Lua.
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: DJ Omnimaga on April 19, 2011, 03:02:21 pm
Yeah true I am glad they posted a news about Lua. I think it helped that people upload Lua converters there. That said the news was not very late, because we announced Lua very recently anyway.
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Munchor on April 19, 2011, 03:03:10 pm
Yeah true I am glad they posted a news about Lua. I think it helped that people upload Lua converters there. That said the news was not very late, because we announced Lua very recently anyway.

Lua converters are the new quadratic solvers? Everybody has made one :P
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: renatose on April 19, 2011, 03:13:01 pm
Quote
Posted by: Scout
Lua converters are the new quadratic solvers? Everybody has made one

check xD
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Munchor on April 19, 2011, 03:13:56 pm
Quote
Posted by: Scout
Lua converters are the new quadratic solvers? Everybody has made one

check xD

I haven't made one yet, I was thinking of an online one made in Python. I'll try it later.
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: renatose on April 19, 2011, 04:32:22 pm
Is there any way to put a timer and a game won message(at least the smile that tells everithing in minesweeper)?
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: Munchor on April 19, 2011, 04:34:27 pm
Is there any way to put a timer and a game won message(at least the smile that tells everithing in minesweeper)?

I agree that that'd be cool.

Also, @renatose: You should visit more sections of the forum, not just Lua ones and try to get 20 messages to talk to us on OmnomIRC, or join us on IRC EFNet, channel #omnimaga.

But before, you should make a topic here (http://www.omnimaga.org/index.php?board=10.0)!
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: renatose on April 19, 2011, 04:37:44 pm
Also, @renatose: You should visit more sections of the forum, not just Lua ones and try to get 20 messages to talk to us on OmnomIRC, or join us on IRC EFNet, channel #omnimaga.

But before, you should make a topic here (http://www.omnimaga.org/index.php?board=10.0)!
Thank you scout, I'm working on it ;)
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: ExtendeD on April 19, 2011, 04:49:59 pm
renatose: sure, I'll see if I have time for this. But Ndless 3.0 is of course the main priority.
Title: Re: 9sweeper - Minesweeper in Lua for TI-Nspire
Post by: renatose on April 19, 2011, 05:44:50 pm
of course! I did the upgrade to the 3.0 (without the boot2) and never downgraded yet, but I'm missing nDoom ^^