DEV Community

Ioannis Gyftakis
Ioannis Gyftakis

Posted on • Edited on

Make Rock, Paper, Scissor game with Ink "Game Engine"

Recently I discovered Ink narrative language by INKLE that has the Inky editor and it is an alternative to Twine.

You can make interactive text based games easily but you can also insert media like images etc. It could also be useful to teach concepts more interactively, especially on the early steps of programming concepts to beginners.

So here is a simple Rock, Paper, Scissor game that uses basic building blocks of INK language like Choices, Knots, Conditionals, Variables, Lists.

Welcome to Rock, Paper, Scissor game

VAR choice = ""
LIST options = (Rock),(Paper),(Scissor)
VAR result = ""

-> main
=== main ===
Wanna play a round of «Rock, Paper, Scissor»?
    + [Yes]
        -> round
    + [No]
        -> DONE

=== round ===
What do you choose?
 + [Rock]
    ~ choice = "Rock"
 + [Paper]
    ~ choice = "Paper"
 + [Scissor]
    ~ choice = "Scissor"

- You chose {choice} 
~ result = LIST_RANDOM(options)
and I chose {result}.
{
    - choice == "Rock" && result == Scissor:
        You won!
    - choice == "Rock" && result == Paper:
        You lost!
    - choice == "Scissor" && result == Rock:
        You lost!
    - choice == "Scissor" && result == Paper:
        You won!
    - choice == "Paper" && result == Rock:
        You won!
    - choice == "Paper" && result == Scissor:
        You lost!
    - else:
        Draw!
}
-> main

-> END
Enter fullscreen mode Exit fullscreen mode

for more try watching this tutorial which is great.

  • Br, John

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Retry later