Jump to content




QuickType - A Minigame

game computer

6 replies to this topic

#1 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 01 November 2014 - 10:25 PM

QuickType v1.1.1


What it is:

This program is a mini-game. A randomly generated 6 letter word will appear on screen, and you have a certain amount of time (specified by the user) to type it in. If correct, the time gets shorter, and you do it again! It has 3 difficulties. Easy, hard, and Insane. (More details in features section).

How to use it:

Just copy the text below, paste it into the terminal, and run it! It will handle creating the files it needs.

Features:

Three difficulties:
  • Easy: Not case-sensitive. Only Letters. Just copy!
  • Hard: Case-sensitive. Only letters.
  • Insane: Case-sensitive. Letters, numbers, symbols. Good luck!
Easy to add symbols to difficulties. Just look for this part:
Spoiler
Then just add/change/remove stuff in the arrays! Starts at line 59.

Known bugs:

Spoiler

Changelog:

Spoiler

Download:
pastebin get AH002ptP quicktype

http://pastebin.com/AH002ptP


Please report any bugs or suggestions in this thread and I will do my best to accommodate you. Thank you and enjoy QuickType!

Edited by metron80, 03 November 2014 - 11:56 PM.


#2 Saldor010

  • Members
  • 467 posts
  • LocationThe United States

Posted 02 November 2014 - 01:30 AM

I started playing easy mode, I purposefully misspelled a word to leave, it said "You lost!" and took me back to main menu. Then, a couple of seconds into the main menu, it blurted out "Time is up! You lost!" Then went back to the main menu. Might want to look into that, even if it isn't a game breaking bug.

#3 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 02 November 2014 - 01:52 AM

View PostJiloacom, on 02 November 2014 - 01:30 AM, said:

I started playing easy mode, I purposefully misspelled a word to leave, it said "You lost!" and took me back to main menu. Then, a couple of seconds into the main menu, it blurted out "Time is up! You lost!" Then went back to the main menu. Might want to look into that, even if it isn't a game breaking bug.

Ya... It is a problem with parallel.waitForAny. it is supposed to terminate the second function when the first stops, but it doesn't. I'm looking into a way to fix it.

#4 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 02 November 2014 - 01:56 AM

Real quick tip instead of using shell.run("mkdir CCQT") You could use fs.makeDir("CCQT") which allows you to use it when you don't have access to shell :P

Gonna update this post if i can find a way to stop your bug

Noticed something while reading your code, instead of when someone inputs something that you don't allow, there are two things you could do, one turn it into an os.pullEvent instead of read, or put a repeat loop in so that they don't keep trying to crash your system as eventually your code will crash.

These are in your start() function
Example1 repeat on io.read
Example2 os.pullEvent

Found your problem, whenever a user incorrectly enters a word you call start() which means that the game's function still is going on, it's just waiting for start() to end. Eventually that gets killed because the timer goes off and so parallel.waitForAny does what it should be doing, all you need to do instead is just instead of start() in your game functions put return

Edited by Dragon53535, 02 November 2014 - 02:11 AM.


#5 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 02 November 2014 - 03:08 AM

View PostDragon53535, on 02 November 2014 - 01:56 AM, said:

Real quick tip instead of using shell.run("mkdir CCQT") You could use fs.makeDir("CCQT") which allows you to use it when you don't have access to shell :P

Gonna update this post if i can find a way to stop your bug

Noticed something while reading your code, instead of when someone inputs something that you don't allow, there are two things you could do, one turn it into an os.pullEvent instead of read, or put a repeat loop in so that they don't keep trying to crash your system as eventually your code will crash.

These are in your start() function
Example1 repeat on io.read
Example2 os.pullEvent

Found your problem, whenever a user incorrectly enters a word you call start() which means that the game's function still is going on, it's just waiting for start() to end. Eventually that gets killed because the timer goes off and so parallel.waitForAny does what it should be doing, all you need to do instead is just instead of start() in your game functions put return

Thanks. I will fix those.
Edit1: Fixed! v1.1

Edit2: Quick question: Anyone know why on pastebin, it identifies half the text as a comment, and the other half as a string, even though the highlighting syntax is Lua?

Edited by metron80, 02 November 2014 - 03:18 AM.


#6 InputUsername

  • Members
  • 231 posts
  • LocationThe Netherlands

Posted 03 November 2014 - 04:27 PM

View Postmetron80, on 02 November 2014 - 03:08 AM, said:

...

Edit2: Quick question: Anyone know why on pastebin, it identifies half the text as a comment, and the other half as a string, even though the highlighting syntax is Lua?

Probably because the highlighting software Pastebin uses doesn't recognise the --]] you used to terminate the comment as a correct comment terminator.

#7 metron80

  • Members
  • 55 posts
  • LocationSolitude, Skyrim

Posted 03 November 2014 - 11:55 PM

Might as well make the pastebin easier to read. v1.1.1!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users