Giter VIP home page Giter VIP logo

game_crossroad's Introduction

Treasure Island

Instructions

Make your own "Choose Your Own Adventure" game. Use conditionals such as if, else, and elif statements to lay out the logic and the story's path in your program.

To write your code according to my story, you can use this flow chart from draw.io to help you.

However, I think the fun part is writing your own story ๐Ÿ˜Š

๐Ÿงžโ€โ™‚๏ธ ๐ŸŠ ๐Ÿง™โ€โ™‚๏ธ ๐ŸงŸ ๐Ÿงšโ€โ™‚๏ธ ๐Ÿงโ€โ™‚๏ธ ๐Ÿฅท ๐Ÿค– ๐Ÿ‘ฝ ๐Ÿ™€

That said if you'd like to continue with my example, feel free to use the text snippets below...

Text Snippets from my example

  • 'You're at a crossroad. Where do you want to go? Type "left" or "right"'
  • 'You've come to a lake. There is an island in the middle of the lake. Type "wait" to wait for a boat. Type "swim" to swim across.'
  • "You arrive at the island unharmed. There is a house with 3 doors. One red, one yellow and one blue. Which colour do you choose?"
  • "It's a room full of fire. Game Over."
  • "You found the treasure! You Win!"
  • "You enter a room of beasts. Game Over."
  • "You chose a door that doesn't exist. Game Over."
  • "You get attacked by an angry trout. Game Over."
  • "You fell into a hole. Game Over."

Escaping Characters

If you want to use multiple sets of quotes inside a single string, you might have to "escape" some of them using the backslash \. You can see this in my first sentence: 'You're at a crossroad...'. More on escaping characters here.

Extensions

Have a think about how you might write your program to make a player's answers less case-sensitive. In other words, your code should work regardless of whether your user answers "left" or "Left".

You can also add your own ASCII art. Just remember to add three single quotes ''' at the start and at the end of your artwork to turn it into a multi-line string.

Solution

https://replit.com/@appbrewery/treasure-island-end#main.py

game_crossroad's People

Contributors

yuriyberezskyy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.