Vai al contenuto

Challenge 2012-03

Discussione Easy Challenge 1

Write a number guessing game.
The program selects a random number between 1 and 100 and asks the player to guess it.
The program then checks the input and states if it is too high, too low or correct.
If it is correct then the player is told how many guesses they took and asked if they want to play again, if it is incorrect they get another guess.

Easy Challenge 2

Ask the user to input some characters and the program outputs them in alphabetical order.

For example:

Input: hyeldksnsy
Output: dehklnssyy

Easy Challenge 3

Draw a spiral in the GraphicsWindow.

Intermediate Challenge 1

Create a dominoes game between two players, or possibly between the computer and a human player.

Intermediate Challenge 2

Create a program in the GraphicsWindow that shows the Earth orbiting the Sun.
Then add the Moon orbiting the Earth and a rocket orbiting the Moon.

Advanced Challenge

Create some random points with x and y coordinates (say about 20 points).
Then write a program to find the order in which to join all of the points with straight lines with the shortest total length.

As a test you can use your algorithm on these coordinates:

  • 138, 211
  • 546, 102
  • 105, 264
  • 92, 100
  • 215, 383
  • 511, 307
  • 151, 347
  • 376, 276
  • 76, 468
  • 52, 368
  • 260, 501
  • 459, 336
  • 410, 143
  • 461, 58
  • 316, 454
  • 468, 93
  • 535, 162
  • 456, 324
  • 162, 231
  • 391, 283

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.