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 4: The Guessing Game III (Medium)

451 documents found.

# Exercise 4: The Guessing Game III (Medium)

Developer
Tutorial

Module: Editor

Version: 4.2.1 +

User: Developer

Difficulty: Medium

Introduction

In this exercise we will finish our guessing game.

Prerequisites

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

## Description

This is a sequel of the The Guessing Game II (Creating formulas with Futurama). You can download the basis for this exercise (the end-result of the The Guessing Game II exercise) by clicking here.

Guess the number is a game we're creating in Futurama. In this game you have to guess a number that is chosen randomly (by Futurama). This number lies between 0 and 100. When the user enters a number, the game will say whether the guess is correct, or should be higher, or lower.

In this last part of the exercise we further improve our latest version of the game. We enable that once the number is guessed, a new number is chosen. And we make sure that the hint only appears when a number is entered, not by default.

## Assignment

Implement the above named feautres to the game.

Take the following steps to do so:

Multiple times

1. We will use the ClearCache object for this.
Add the ClearCache object at the bottom of the page. In the TargetObject, refer to the 'RandomSelected 0-100' formula.
2. The ClearCache should only be executed when the answer is correct. Therefore, in the Condition property of the ClearCacheObject, refer to the Formula 'AnswerCorrect'.

Visibility

1. Select the WebLabel in which the hint is displayed. Set the property 'Visible' of this WebLabel to 'False'. Verify in your browser that the Message is not displayed now.
2. Within the Button object, create an Action object, named 'Set Message Visible'.
3. In the 'TargetControl' property, refer to the WebLabel in which the hint is displayed.
4. Within the Action object, create a Fixed Type Boolean, named 'Visible'. Set the value of the Fixed to True.  This means, when the button is clicked, the visibility property of the Hint message will be set to 'True'.
5. Save your file and verify in your browser that the message is now shown after you've clicked the button.

## Tips

• In the previous Exercise we filled in the Unique value of the Random Formula by using the Date Formula Now(). Because it's result is constantly changing, we get a new random number each time the website is started again. The Formula is only executed when its value is asked and has not been calculated yet.
• The function ClearCache resets the target object ‘RandomSelected 0-100’. It empties the value that is cached. Therefore, when continuing the game, the Formula will be referred to again, and the new 'Now()'-result will be used as the unique value for the Random Formula.
• You can use the VersionNumber property of the Document to enable version management.