Author Topic: 9sweeper - Minesweeper in Lua for TI-Nspire  (Read 12616 times)

0 Members and 1 Guest are viewing this topic.

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
9sweeper - Minesweeper in Lua for TI-Nspire
« 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
« Last Edit: April 17, 2011, 10:41:44 am by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #1 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

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #2 on: April 17, 2011, 10:24:54 am »
Really nice ! :o

Congratulations on coding this as your second day of Lua :P
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #3 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 ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #4 on: April 17, 2011, 10:39:53 am »
Very nice ExtendeD!  I will be sure to try this out! :D


Offline GB

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 147
  • Rating: +15/-3
  • Use Microhard WindOS today!
    • View Profile
    • MICROHARD CORPORATION
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #5 on: April 17, 2011, 02:56:49 pm »
I just wish there was some way to get Lua to work in 2.0...
TI-86 USER
CASIO PRIZM USER
TI-NSPIRE USER
TI-84 PLUS SILVER EDITION USER
TI-83 PLUS USER

PROJECTS:

Microhard Paint
http://www.omnimaga.org/index.php?topic=11915.0

TI-Nspire Character Map
http://www.omnimaga.org/index.php?topic=7725.msg142555#msg142555

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #6 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

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #7 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.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #8 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.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #9 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

Offline renatose

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 209
  • Rating: +4/-0
  • watch out the power balls
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #10 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

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #11 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.

Offline renatose

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 209
  • Rating: +4/-0
  • watch out the power balls
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #12 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)?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #13 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!

Offline renatose

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 209
  • Rating: +4/-0
  • watch out the power balls
    • View Profile
Re: 9sweeper - Minesweeper in Lua for TI-Nspire
« Reply #14 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!
Thank you scout, I'm working on it ;)