Partilhar via


Small Basic Challenges for September - Traffic Light, Array from CSV, and a Stick Fighting Game!

Special thanks to LitDev for hosting these challenges!

These monthly challenges are intended for people who are learning to program for the first time or for those returning to programming who want to start using Small Basic. Some will be easy, some will be hard - but they will all make you think, and more importantly be GREAT FUN!

Please post your solutions / partial solutions / questions / feedback etc. into this thread that will remain 'sticky' for the month. The only rule is that your solution must use standard Small Basic methods (no extensions).

It would be good if people could post their problems with these challenges so that a discussion can start so that everyone can learn from each other.

Also post feedback on the kind of challenges that you want to see more of in the future.

Text Challenge

  • Write a program to read and write an array of Small Basic data to and from a csv file.

 

Variable Type Challenge

  • Write a program that checks a Small Basic variable and determines if it is an array or not:
  • If it is an array, then the number of elements is reported
  • If it is not an array, then it is checked to see if it is a number or not
  • If it is a number, then it is determined if it is positive or negative and if it is an integer or decimal number

 

Graphics Challenge 1

Draw a flower.

Graphics Challenge 2

Draw a traffic light that changes through the correct lighting sequence, perhaps using the Timer object.

Game Challenge

Write a simple stick man fighting game.  see some recent posts for some ideas on this.

 

Community Suggestions (by Nonki)

  • Write a program to find an absolute path from an input relative path.  While it is assumed that the current path is Program.Directory.

 

For example, if the current directory is "C:\Users\Nonki\Documents",

Input ".." → Output "C:\Users\Nonki"
Input "test" → Output C:\Users\Nonki\Documents\test"

  • Draw (or fill) a Trapezoid.
  • Make a kitchen timer.

 

Do you have an idea for a future challenge? Please post it here!

 

Thanks to LitDev and the other community contributors!

   - Ninja Ed

Comments

  • Anonymous
    September 06, 2014
    What was cool is that several people contributed traffic light solutions right away! The community participation is great!

  • Anonymous
    November 09, 2015
    what was bad was that no one likes this

  • Anonymous
    November 09, 2015
    Jacky, what do you not like, and why? Thanks!

  • Anonymous
    January 11, 2016
    I need more detail

  • Anonymous
    January 11, 2016
    Please give more detail

  • Anonymous
    January 11, 2016
    Jacky, More detail like in how to build the solutions? That makes sense. It is a bit of a challenge to start from scratch. You can go into the latest challenges here: social.msdn.microsoft.com/.../challenge-of-the-month-januaryfebruary-2016 True, that it's very open/vague, but you can dig into the solutions that the other community members are developing. Then just import their code and play around with it, seeing if you can improve it or make it different. Then post your results. If you want a very clear and simple set of instructions, you can follow the Curriculum: social.technet.microsoft.com/.../16299.small-basic-curriculum.aspx Or the Getting Started Guide: social.technet.microsoft.com/.../16059.small-basic-getting-started-guide.aspx It's all free, of course. Thanks!

  • Anonymous
    February 24, 2016
    I need help on the task please!!!!!