Small Basic – December Challenges


Have a go at some of this month's Small Basic Challenges.

Post your solutions. partial solutions, see what other come up with and discuss any methods etc on the forum site linked above.

Small Challenges

  1. Write a program to find the square root of a number entered by a user.
  2. Write a program to draw a festive winter or Christmass card scene - even maybe an electronic XMas card you can email a Program ID link for - so make sure the graphics work well with online web Silverlight if you can.
  3. Write a program to count the number of characters, words and lines in a text file.

Interface Math Challenge

  1. Write an interface program to give the correct change (number and value of notes and coins) when the user purchases an item of a certain value and pays with a large value note.

The interface will come up with the cost of an item selected (e.g. £4.25), the user then enters the value of a note to pay (e.g. £10) and the change is calulated in your currency choice (e.g. £5 note 50p 20p 5p).

Graphics Challenges

  1. Write a program to draw a dice showing the required number of spots when the user rolls it.  You can have a button to roll the dice and randomly pick a result to draw.
  2. Write a program to show a guage that is updated on a timer depending on how a variable is changing.  It can be any type of guage with a needle or lights that go on or a bar guage like a thermometer etc.

Game Challenge

Write a text based RPG game.  Try to make the game engine general so that the game objects etc can be loaded from a file.  My suggestions are to:

  • Draw a simple diagram of what it can do.
  • Decide on the data - for example:

Rooms (any location) have 1 or more doors and 1 or more objects in it and a description.

Doors (links rooms) have 2 rooms that the door links, may be locked or unlocked and if locked which object unlocks it.

Objects (anything found in rooms) they can be picked up, dropped or used to perform actions like open doors or make other objects visible (hidden door or light switch to see objects etc) or any other fun actions.

  • Store the data logically in arrays (maybe read from a file)
  • Decide how the user will interact - e.g. choose options from a list
  • Write a game engine to ask questions, like which doors to go through, what to pick up or drop, to look for objects etc.
  • Try to set out a goal and interesting game play with a variety of objects and functions.

Comunity Suggestions (By Nonki)

  1. Write a program to find the star (zodiac) sign from birthday.
  2. Create a bowling score calculator.
  3. Create a program to draw all kind of tetrominoes (pieces used in Tetris).

Community Suggestions (by Pappa Lapub)

  1. Create a file filled with a given number of randomly generated characters or lines.
  2. Split a given file (eg. from 1.) to a specified number (eg. 3) of parts like FileName_1.part to FileName_3.part and save these into a folder.
  3. Merge all the FileName_N.part files from a folder into a combined file again.
  4. Compare two files (eg. orig. file from 1. and merged file from 3.) if they are identical.
  5. Bonus: If you do all from above, combine the functions 1.-4. into a single program.
Comments (1)

  1. Text based RPGs rule!

    I also love the Tetris idea!

    A great month of challenges!!

Skip to main content