Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

This is a Lua project that simulates a Magic Eight Ball, allowing users to ask yes-or-no questions and receive randomized responses.

License

Notifications You must be signed in to change notification settings

izzycodes02/magic-eight-ball

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Magic Eight Ball Lua Project

This is a simple Lua project that simulates a Magic Eight Ball. The user asks a yes-or-no question and the Magic Eight Ball responds with one of its pre-set answers. In this project, I am going to create a simple Magic Eight Ball using if/elseif/else statements and boolean expressions in the Lua programming langauge.

How to Run the Program

Via Cloning/Downloading

  1. Install Lua on your computer. You can download Lua from the official website: https://www.lua.org/download.html
  2. Clone or download the repository to your computer.
  3. Open a terminal or command prompt window and navigate to the directory where the files are located.
  4. Run the program by entering the following command: lua magic_eight_ball.lua
  5. The program will ask you to enter a yes-or-no question. Type your question and press Enter.
  6. The Magic Eight Ball will randomly choose one of its pre-set answers and display it on the screen.
  7. To exit the program, simply close the terminal or command prompt window.

Via Repl.it

  1. Click this link to the repl of this project: link
  2. The program will ask you to enter a yes-or-no question. Type your question and press Enter.
  3. The Magic Eight Ball will randomly choose one of its pre-set answers and display it on the screen.

Customising the Answers

If you want to customise the answers of the Magic Eight Ball, you can edit the answers table in the magic_eight_ball.lua file by cloning or downloading the repository. Simply add or remove answers from the table to change the possible responses of the Magic Eight Ball.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Acknowledgments

This project was inspired by the classic Magic Eight Ball toy! Thanks to Lua for providing a simple and flexible programming language!

About

This is a Lua project that simulates a Magic Eight Ball, allowing users to ask yes-or-no questions and receive randomized responses.

Topics

Resources

License

Stars

Watchers

Forks

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.