Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
21 May, 2013, 11:18:35 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Hangman for Lua -  (Read 1980 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Topic starter
Total Post Ratings: +42

View Profile
« on: 23 December, 2011, 20:32:09 »
0

I have recently created a Hangman program with Lua for the Nspire. This is my second Lua Project, the first has yet to be released. Right now, I have over 100 words in the dictionary with categories. I plan to add two-player and possibly better sprites for the hangman.

I would share a screenshot on here or a download, but how do you do that?  Huh?
Additionally, how do you do an animated screenshot?

Thanks in advance!
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #1 on: 23 December, 2011, 20:38:42 »
0

nice project, finally a hangman with words Smiley
and two player would be very nice.. does the one-player version already work totally?

well, my way isn't the way it should be done, but it works:

i use autoscreenrecorder to take an avi screenshot (so a movie)
and then i convert it with avi to gif converter

this results in colored animated screenshots, but they are sometimes "shocky" (low framerate)
« Last Edit: 23 December, 2011, 20:39:31 by Nick » Logged

cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Topic starter
Total Post Ratings: +42

View Profile
« Reply #2 on: 23 December, 2011, 21:10:48 »
0

I think the one-player should be totally working, but I haven't tested all of the words. Drawing, lives, all that is done.

For the screenshots, how do you use the img tags to attach a picture on here? Sorry if it wasn't clear before.
Logged

Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #3 on: 23 December, 2011, 21:14:18 »
0

well, you upload it to removed from game and then copy the second link (the one with the [.img.]URL[./img.] but without those periods, those are to make it not look like the tags in here) and then just past it in here and you should be fine
« Last Edit: 23 December, 2011, 21:15:34 by Nick » Logged

3rik
LV3 Member (Next: 100)
***
Offline Offline

Gender: Male
Last Login: 02 April, 2013, 22:45:02
Date Registered: 09 August, 2011, 04:04:54
Location: Right over there.
Posts: 92


Total Post Ratings: +8

View Profile
« Reply #4 on: 23 December, 2011, 21:17:46 »
0

Hangman's a great idea!

To post images type

[img]http://image url[/img]
or
[img width=number height=number]http://image url[/img]


A good reference for bbcode is http://www.omnimaga.org/index.php?action=help;page=post

If you need ideas for more words you can look here: http://dictionary-thesaurus.com/wordlists.html
It has tons of words broken down into categories.
« Last Edit: 23 December, 2011, 21:21:17 by 3rik » Logged

Userbars
Loulou 54
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 15:27:36
Date Registered: 22 July, 2011, 21:19:29
Location: Meurthe-et-Moselle FRANCE
Posts: 152


Total Post Ratings: +34

View Profile WWW
« Reply #5 on: 23 December, 2011, 23:03:53 »
0

Woow you gave me an idee !

I'm making a translator on calc, in Lua.
It could be fine to join a hangman game, since I have more than 50 000 words either in english or in french !! Smiley

Maybe I could integrate your program into my translator, when you have finished it, if you agree ?
Logged

Some of my program available here.. Smiley
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Topic starter
Total Post Ratings: +42

View Profile
« Reply #6 on: 23 December, 2011, 23:16:24 »
+2

@3rik - Thanks for the guide! I should've read that.

@Loulou - That would be absolutely insane to have 50,000 words! I've read the page about your translator and it would be an honor to integrate my humble program into yours. It should be pretty easy to add words in.

@Nick - I remember that was down for a bit, but it's back up. Thanks!

Here are some screenshots:



The screenshots are a bit big  Tongue

I've also included the .tns and source. Please keep in mind I created this in two days and more features/improvements are going to be added. The program is actually pretty small, only about 250 lines.

* hangmandev.lua (6.58 KB - downloaded 54 times.)
* Hangman.tns (3.04 KB - downloaded 43 times.)
Logged

Loulou 54
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 15:27:36
Date Registered: 22 July, 2011, 21:19:29
Location: Meurthe-et-Moselle FRANCE
Posts: 152


Total Post Ratings: +34

View Profile WWW
« Reply #7 on: 23 December, 2011, 23:46:52 »
0

Nice ! Smiley

Maybe you could add difficulty levels. Wink
Keep us aware of the progress, if you add some features !
I will be pleased to adapt it in my project. Smiley

I will have to adapt it to my data base, (I can not make categories though..) and to add a language choice. (french, english or both.) Smiley
Logged

Some of my program available here.. Smiley
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     
Nick
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: Yesterday at 20:44:19
Date Registered: 05 June, 2011, 20:01:07
Location: 51° 12′ 34″ N, 3° 13′ 31″ E
Posts: 1178


Total Post Ratings: +158

View Profile WWW
« Reply #8 on: 24 December, 2011, 03:45:32 »
0

looks great! and it would be nice if those two projects were merged to one nice program..
Logged

Loulou 54
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 15:27:36
Date Registered: 22 July, 2011, 21:19:29
Location: Meurthe-et-Moselle FRANCE
Posts: 152


Total Post Ratings: +34

View Profile WWW
« Reply #9 on: 24 December, 2011, 16:31:47 »
0

looks great! and it would be nice if those two projects were merged to one nice program..
I think I'll put the hangman game in a second "tab". (I mean the 1.1, 1.2,... stuffs) It would be ok I think, and easier than integrate the hangman in my script.. Smiley
Logged

Some of my program available here.. Smiley
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Topic starter
Total Post Ratings: +42

View Profile
« Reply #10 on: 25 December, 2011, 05:06:37 »
0

Well, being Christmas Eve and all, didn't code too much. I just added a function that allows the user to press the enter key after gameover so they can figure out what word it was. I personally like figuring out what word I was trying to guess. I'll work on two-player later. Two-Player is just one person creating a word for the other person. I could make it more advanced later, like two words, and the two people take turns guessing.

I will add difficulty levels very soon and some more tricky/easy words.

As another question, one of my "beta testers" (my brother) wants me to change "cesium" to "caesium". Opinions?  Smiley

Loulou 54 - How would you input letters with accents? And as a side note, how do you get a second tab for the Lua program?

Happy Holidays everyone!
Logged

saintrunner
Custom Spriter: You ask it! I'll Make it!
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 09 March, 2013, 02:00:40
Date Registered: 27 October, 2011, 21:52:46
Location: Right here....I think?
Posts: 1776


Total Post Ratings: +97

View Profile WWW
« Reply #11 on: 25 December, 2011, 05:24:44 »
0

This actually looks pretty good! I think I might do this for TI 80's
Logged

My Sprites Thread   :Updated often Smiley for your viewing pleasure

GAMES:
Loulou 54
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 15:27:36
Date Registered: 22 July, 2011, 21:19:29
Location: Meurthe-et-Moselle FRANCE
Posts: 152


Total Post Ratings: +34

View Profile WWW
« Reply #12 on: 25 December, 2011, 20:19:27 »
0

Loulou 54 - How would you input letters with accents? And as a side note, how do you get a second tab for the Lua program?

There is two ways : you can type it through the "char-catalog", but the most user friendly is to use the little flag key after the letter you want to accentuate. It works even in a Lua script. Smiley (but here, it's a bit more difficult because the program reacts directly after the key press.)
But in a hangman game, the player doesn't have to guess the accents. He only has to type "e" and the "é", "è", "ê" are recognized normally.
So you should try to recognize that a "é" is discovered when pressing "e".. ^^
(if you have time and desire to do it) Grin

An advice : I don't know what tools you use, but generally if you type an accentuated character in your source code it will produce strange bugs like close immediately the student software..
So, each time you have to put an accentuated character in your code, use the string.uchar(...) function with the code of the character you want.
And if you want to have the code of a character, for example "é" use the function ord("é") on the calculator.

So you know this problem now and you won't be surprised if it occurs..  Cool
I have been very annoyed because of that...

Good luck !
Logged

Some of my program available here.. Smiley
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     
cyanophycean314
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 19:28:34
Date Registered: 07 December, 2011, 02:44:32
Location: Somewhere?
Posts: 363


Topic starter
Total Post Ratings: +42

View Profile
« Reply #13 on: 27 December, 2011, 03:41:24 »
0

Well, difficulty has been added, currently working on two player. Have added some words for more very easy/tricky words.

How would you guys do letter spacing? I thought about concatenating the word as a string, but one of my fellow 84 programmers pointed out that the letters would constantly move. I could always make it have more space, but that means shorter words. Is there a fixed width font for the Nspire?

Tools I use -
IDE - Notepad++
Testing - Nspire CX CAS Software + oclua
Compilation? - Luna v0.2b
Consultation - Inspired-Lua and Omnimaga

Edit: 2 Player Done!
« Last Edit: 27 December, 2011, 04:10:04 by cyanophycean314 » Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 08:22:03
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50208


Total Post Ratings: +2612

View Profile WWW
« Reply #14 on: 27 December, 2011, 08:07:51 »
0

Seems pretty nice. As for uploading, you can put it in Omnimaga archives (although I'm unsure if you needed 40 posts or 20 for that). Otherwise there's Ticalc.org and Ti-Planet (French). If you want to upload directly in a post, click Reply and there should be an upload form below where you type text now. Your game might get lost with the other posts and topics eventually, though, so it's always good to upload it in an archive.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.224 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.