Scratch for Java

Diese Seite ist noch nicht übersetzt. Sie wird in ihrer Originalsprache angezeigt.

Quiz

Asks three questions and reacts to the answers, using ask() and getAnswer(). The question box appears at the bottom of the stage, the same place Scratch puts it. Type an answer and press Enter.

a quiz asking questions at the bottom of the stage

There are no image or sound files in this project. The alien and the backdrop both come from the built-in sprites.

Unlike Scratch, ask() does not pause anything, so the stage checks whether a question is still waiting before looking at the answer:

public void run() {
  if (this.isAsking()) {
    return;
  }
  String answer = this.getAnswer();
  ...
}

Run it here

Type an answer into the box at the bottom of the stage and press Enter.

Source Code:

Quiz

Teilbare URL erstellen

Abschnitte auswählen