This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Saldor010's profile picture

Hangman

Started by Saldor010, 04 July 2014 - 12:35 PM
Saldor010 #1
Posted 04 July 2014 - 02:35 PM
Hey there!
Message from future me, if you enjoy this game (or even if you don't), you should check out my latest game! It's way better than this one, I'm sure you'd love it ;)/>
Click the link here to check it out!
Back to your original post already in progress..

This is my first program (in CC) that I've ever actually finished, I hope you enjoy it ;)/>

HANGMAN

Instructions:
.. It's hangman. If you don't know how to play it.. :P/>

Pictures:

[attachment=1781:Hangman1.JPG]
[attachment=1782:Hangman2.JPG]
[attachment=1786:Hangman5.JPG]
[attachment=1811:Hangman6.JPG]
[attachment=1820:Hangman7.JPG]
[attachment=1821:Hangman8.JPG]

Install:

Just type in

pastebin run u15WwrLd
-And follow the installer's instructions!

Known bugs:

Trying to install to the root folder (Typing in "/" in the installer when it prompts) will cause the program to hang.

Upcoming Features:

An in-game dictionary writer, so you don't have to write them externally.

How to make a Custom Dictionary:


1. Create a file inside the "Dicts" folder of your Hangman root.
2. Open the file. (Duh)
3. Type in whatever words you want to use, always adding an | at
the end of it. (This is crucial for .dict files) Also make sure that they are
all lower case.
4. Run Hangman and go to the dictionary list. If your dictionary is not there, you probably didn't put it in the Dicts folder.
5. Load your dictionary
6. Have fun!


Change Log:

7/22/14: VERSION 1.3.2 : Added support for folders in the Dictionary Menu : Added support for phrases (2 or more Words at a time) in Dictionaries. : Fixed a bug : Added an option to just "Go Back" when you're in the dictionary menu.

7/21/14: VERSION 1.3.1 : Fixed 3 bugs in the installer : Removed remaining "Debug Prints" in the installer.
7/21/14: VERSION 1.3 : Custom dictionary support : 2 Additional Dictionary's added (Lua and Minecraft words) : Because of the need for external files
(instead of the entire game being in 1 file), I also had to create an installer. The installer will NOT auto update, so for every new update, you will need
to re-download it.
7/8/14: VERSION 1.2 : Fixed a lot of bugs.. a lot.
7/7/14: VERSION 1.1 : Added more description and tweaked the Points system : Fixed the "Exiting after first game without the option to keep playing" bug. : And some other minor changes
7/5/14: Points added : You can now play multiple games on only 1 program run : Points travel across games : And some other minor changes
7/4/14: Hints added (Can only be used once per game, only hint available as of yet is a free letter.)
7/4/14: Bug fixed - Still being able to guess letters that you already guessed. : Updated dictionary
7/4/14 : VERSION 1.0 : Released!


Please let me know how you enjoy it, and if you find any bugs, please tell me so I can fix them. Because if you don't tell me, well, I can't really fix them can I? :rolleyes:/>

Yes, I know, the GUI sucks, I will improve it in the future.
Edited on 05 June 2019 - 08:14 PM
Saldor010 #2
Posted 05 July 2014 - 04:25 PM
I added a point system to the game! If you haven't tried it out yet, now's the time!
Saldor010 #3
Posted 07 July 2014 - 10:25 PM
Feedback would be appreciated ;)/>
Bomb Bloke #4
Posted 08 July 2014 - 01:53 AM
Scoring certainly needs work, it always states I guessed none of the characters, the word multiplier doesn't apply to the total, and I'm not sure the limbs score is right either…

It's "Thanks", not "Thank's".

The game always starts with the rope drawn, even though I haven't had time to get any letters wrong yet.

I can't see any offer to keep playing - it always exits after the first round.

Other than those points, not bad. :)/> You've certainly done a good job of choosing words I can't guess…
Saldor010 #5
Posted 08 July 2014 - 02:03 AM
Scoring certainly needs work, it always states I guessed none of the characters, the word multiplier doesn't apply to the total, and I'm not sure the limbs score is right either…

It's "Thanks", not "Thank's".

The game always starts with the rope drawn, even though I haven't had time to get any letters wrong yet.

I can't see any offer to keep playing - it always exits after the first round.

Other than those points, not bad. :)/> You've certainly done a good job of choosing words I can't guess…

Yeah, I should probably add some more information to the points, I could see how it might be confusing for people who don't understand how it works.

Sorry, must have missed that one. Where is it? On the forum post or in game?

Yeah, in my version it starts with the head being drawn first when you miss a letter.

Hm, maybe it's an outdated version that I have uploaded to pastebin. I'll check after I post this. EDIT: Hm, it's working for me. Are you using an emulator? Are you using CC 1.6?

Thanks!
Edited on 08 July 2014 - 12:05 AM
Bomb Bloke #6
Posted 08 July 2014 - 02:10 AM
Sorry, must have missed that one. Where is it? On the forum post or in game?

In the game, on exit.

Hm, maybe it's an outdated version that I have uploaded to pastebin. I'll check after I post this. EDIT: Hm, it's working for me. Are you using an emulator? Are you using CC 1.6?

1.63.
Saldor010 #7
Posted 08 July 2014 - 02:18 AM
Sorry, must have missed that one. Where is it? On the forum post or in game?

In the game, on exit.

Hm, maybe it's an outdated version that I have uploaded to pastebin. I'll check after I post this. EDIT: Hm, it's working for me. Are you using an emulator? Are you using CC 1.6?

1.63.

Okay, I'll fix it while I'm fixing the scoring.

Are you using an emulator?
Bomb Bloke #8
Posted 08 July 2014 - 02:43 AM
No, I'm running CC 1.63, as opposed to any imitation of it.
Saldor010 #9
Posted 08 July 2014 - 02:46 AM
No, I'm running CC 1.63, as opposed to any imitation of it.

Weird. I don't know why it isn't working then. Try deleting it and reinstalling it?
Bomb Bloke #10
Posted 08 July 2014 - 03:06 AM
lolno. If the download was corrupt, it wouldn't be running at all. ;)/>

Looking at your code, it's 'cause of the way you're pulling events.

Every character pressed triggers two of the things - a key event, followed by a character event. So if you press eg space, a key event with a value of 57 goes into the queue, and a char event with a value of " " goes into the queue.

Say a round is played. The last thing you do before breaking out of the game function's loop is to tell the user to press "any key", and then you pull a key event. If eg space is pressed, you'll catch the key event generated, but the char event stays in the queue for now.

The game function returns, then you call your play function - this asks whether to play again, then pulls a char event. If eg space was pressed before, then it'll pull the corresponding char event now, and take that as a "no".

Easy fix would be to switch lines 272 and 285 to pull char events.

(And fix line 305 while you're at it!)
Edited on 08 July 2014 - 01:08 AM
Saldor010 #11
Posted 08 July 2014 - 03:12 AM
I already fixed the "Thank's" issue, that was one of my first priorities when I started the edits to Hangman. I am fixing the points right now so it's more descriptive and accurate, and I just fixed lines 272 and 285. When I'm done, I'll post it to pastebin, and I'll notify you so you can test it and make sure that all of the bugs you pointed out are fixed.

EDIT: And actually, I didn't think the download was corrupt, I thought that you may have downloaded it a couple days ago (the older version) and didn't have time to test it.
Edited on 08 July 2014 - 01:14 AM
Saldor010 #12
Posted 08 July 2014 - 03:28 AM
Version 1.1 uploaded! (I decided to start naming the versions now.)
Saldor010 #13
Posted 08 July 2014 - 06:18 PM
Version 1.2 Uploaded!
Saldor010 #14
Posted 21 July 2014 - 09:21 PM
Version 1.3 Uploaded! Run the new installer and try out the 2 new Dictionaries! :lol:/>
Cookiezi #15
Posted 21 July 2014 - 10:07 PM
Neat program, you could probably include this game in like an Arcade of sorts in Servers where players could just play games like these: Compete with eachother etc.
I would suggest going a bit further with the whole game concept and making a Game Center, I saw a game center made by someone before but I can't remember who it was.
Saldor010 #16
Posted 21 July 2014 - 10:56 PM
Neat program, you could probably include this game in like an Arcade of sorts in Servers where players could just play games like these: Compete with eachother etc.
I would suggest going a bit further with the whole game concept and making a Game Center, I saw a game center made by someone before but I can't remember who it was.

I'll think about it, and thank you :D/>
ShadowDisruptor #17
Posted 13 December 2014 - 05:11 AM
I'd be glad to implement this into the store. Only thing is you need to create an un-install script to delete all the files it creates. After that, it should be good to go in.