Git Product home page Git Product logo

petals-around-the-rose's Introduction

Petals-Around-the-Rose

Petals Around the Rose brain teaser

The name of the game is Petals Around the Rose, and that name is significant. You can only be told that much. You can also be told that every answer is zero or an even number. You can also be told the answer for every throw of the dice that are used in the game. And that's all the information you get.

Spoiler Warning: try the game without reading roll script!

Run the script, you are given an answer after every roll, try to figure out the pattern and guess the correct answer for the next roll.

curl https://raw.githubusercontent.com/zocoi/Petals-Around-the-Rose/master/roll.rb
ruby roll.rb

Enjoy and good luck!

Bonus: the game is inspired by Bill Gates and Petals Around the Rose

➜  Petals-Around-the-Rose git:(master) ✗ ruby roll.rb
Welcome to Petals Around the Rose
Let's start
Roll 1:
-----
|o o|
|o o|
|o o|
-----
-----
|o  |
| o |
|  o|
-----
-----
|o  |
|   |
|  o|
-----
-----
|o  |
| o |
|  o|
-----
-----
|o  |
| o |
|  o|
-----
The answer is: 6
Press Enter to continue next roll...

Roll 2:
-----
|o  |
|   |
|  o|
-----
-----
|   |
| o |
|   |
-----
-----
|o  |
|   |
|  o|
-----
-----
|o o|
|o o|
|o o|
-----
-----
|o  |
|   |
|  o|
-----
The answer is: 0
Press Enter to continue next roll...

Roll 3:
-----
|o  |
|   |
|  o|
-----
-----
|o o|
| o |
|o o|
-----
-----
|o  |
| o |
|  o|
-----
-----
|o  |
|   |
|  o|
-----
-----
|o o|
|   |
|o o|
-----
The answer is: 6
Press Enter to continue next roll...

Roll 4:
-----
|o o|
|o o|
|o o|
-----
-----
|   |
| o |
|   |
-----
-----
|o  |
|   |
|  o|
-----
-----
|o o|
|o o|
|o o|
-----
-----
|o o|
|   |
|o o|
-----
The answer is: 0
Press Enter to continue next roll...

Roll 5:
-----
|o  |
|   |
|  o|
-----
-----
|   |
| o |
|   |
-----
-----
|   |
| o |
|   |
-----
-----
|o o|
| o |
|o o|
-----
-----
|o o|
| o |
|o o|
-----
The answer is: 8
Press Enter to continue next roll...

Roll 6:
-----
|o o|
|   |
|o o|
-----
-----
|o  |
|   |
|  o|
-----
-----
|o o|
|o o|
|o o|
-----
-----
|o o|
| o |
|o o|
-----
-----
|o o|
|   |
|o o|
-----
You are now warm, let's guess the answer. Enter your answer:
4
Correct!
The answer is: 4
Press Enter to continue next roll...

Roll 7:
-----
|   |
| o |
|   |
-----
-----
|o o|
| o |
|o o|
-----
-----
|o o|
|   |
|o o|
-----
-----
|o o|
|o o|
|o o|
-----
-----
|   |
| o |
|   |
-----
You are now warm, let's guess the answer. Enter your answer:
4
Correct!
The answer is: 4
Press Enter to continue next roll...

Roll 8:
-----
|   |
| o |
|   |
-----
-----
|o  |
|   |
|  o|
-----
-----
|o  |
|   |
|  o|
-----
-----
|   |
| o |
|   |
-----
-----
|o o|
|o o|
|o o|
-----
You are now warm, let's guess the answer. Enter your answer:
0
Correct!
The answer is: 0
Press Enter to continue next roll...

Roll 9:
-----
|o o|
|o o|
|o o|
-----
-----
|o  |
| o |
|  o|
-----
-----
|   |
| o |
|   |
-----
-----
|o o|
| o |
|o o|
-----
-----
|o o|
| o |
|o o|
-----
You are now warm, let's guess the answer. Enter your answer:
10
Correct!
The answer is: 10
Press Enter to continue next roll...

Roll 10:
-----
|   |
| o |
|   |
-----
-----
|   |
| o |
|   |
-----
-----
|o o|
| o |
|o o|
-----
-----
|   |
| o |
|   |
-----
-----
|o  |
| o |
|  o|
-----
You are now warm, let's guess the answer. Enter your answer:
6
Correct!
The answer is: 6
Press Enter to continue next roll...

Roll 11:
-----
|   |
| o |
|   |
-----
-----
|o  |
| o |
|  o|
-----
-----
|o o|
| o |
|o o|
-----
-----
|   |
| o |
|   |
-----
-----
|o o|
|   |
|o o|
-----
You are now warm, let's guess the answer. Enter your answer:
6
Correct!
The answer is: 6
Press Enter to continue next roll...
You guess the correct answer more than 5 times. Looks like you figured it out. Congrats!

petals-around-the-rose's People

Contributors

zocoi 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.