Keywords: clear search

## Welcome to the Futurama Support Site

The Futurama Support Site is the website where you can find Futurama and Futurama Vision documentation. If you have any questions about the support pages or if you want to provide us feedback please send us an e-mail.

Index Exercise 5: Reversed Guessing (Difficult)

451 documents found.

# Exercise 5: Reversed Guessing (Difficult)

Developer
Tutorial

Module: Editor

Version: 4.2.1 +

User: Developer

Difficulty: Difficult

Introduction

In this exercise we will display a game and create an action.

Prerequisites

- The Futurama Editor must be installed.
- Futurama Runtime must be installed.
- Completing the tutorial Working with Actions in Futurama first, is recommended.

## Description

Reversed Guessing is a game where Futurama guesses the number between 0 and 100 you have in mind.

## Assignment

We want a webpage in which you can click a Lower or Higher button each time Futurama guesses a number between 0 and 100. Depending on whether the number should be higher or lower, Futurama adjusts its guess. And off course it will do that in the most efficient way: by chosing the number exactly in the middle of the remaning boundaries.

Take the following steps to do so:

1. Create a WebPage and within the WebPage a button 'Higher' and 'Lower'.
2. Outside the WebPage, create two UserVariables, both type Double, named Limit Low and Limit High.
3. The Default Value of Limit Low should be 0, the Default Value of Limit High should be 100.
4. Create a Formula 'Guess', Type Double: =Round((Limit_Low + Limit_High) / 2, 0)
5. Name the RadioGroup: Options, and the three RadioButtons: ‘Higher’, ‘Lower’ and ‘Correct’. Fill in the Properties, Text  the same name in as you did in the Editor. (Higher, Lower and Correct)
6. Within the Button 'Higher', create a ChangeValue that adapts the lower limit of Futurama: The UserVariable Lower Limit gets the value of the Formula 'Guess'. (Explanation: When the button 'Higher' is clicked, the current Futurama guess can serve as the new lower limit.)
7. Likewise, create a corresponding ChangeValue in the Button 'Lower'.
8. Create a WebPanel 'New guess', that will display Futurama's guess: create a WebLable that displays the current value of the 'Guess' formula. For instance a concatenate formula that says: Concatenate(New guess: , FormatNumber(Guess, ))
9. Your application should work now. There's no natural ending to the game yet, as there's no button that you can click to confirm that Futurama's Guess is correct.
10. Instead, we do create a reset-button:
Create a WebPanel 'Reset', that holds a button. Within the button, create ChangeValues that reset the Lower and Upper Limit to their default value.

## Tips

• Do not forgot to refer to your WebPage in the StartWebPage property of your Document.
• Fill in the text property of the buttons to see them displayed in your website. You could also use CSS or an image to give the buttons an approriate look.