locked
Challenge of the Month - November 2011 RRS feed

  • General discussion

  • Welcome to the monthly SmallBASIC Challenge!

    I know it is a few days early, but here is November's Challenge! 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.

    These challenges are intended for people who are learning to program or for more experienced programmers who want to start using SmallBASIC after using a different language. 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 SmallBASIC methods (no extensions).

    Easy Challenge

    • Write a program that will turn and move the turtle according to the user's input from the TextWindow

     

    Intermediate Challenge
    • Write a program to create random "songs" using Sounds. There should be a 9/10 chance of the next note being a note close in pitch to the previous one, but a 1/10 chance of the next note being very different in pitch from the previous note.
    • Modify your program to save the song in any format you choose. For a little more of a challenge, try encrypting the file save. Your program should also be able to open saved files. (HINT! Some Classes you need are: Sounds, Math, and File)

    Advanced Challenge 1

    • Make a connect four game. Before the game starts, your program should give you the option of playing a person or the computer, and choose which color you want (just for a little more challenge). If you don't know what Connect-4 is, read this wikipedia thing: http://en.wikipedia.org/wiki/Connect_Four

    Advanced Challenge 2

    • Try doing a painting program. This program should let you choose color (HINT use an image from the internet for color wheel, or make a little slider for RGB, or let the user enter hexadecimal colors). Also, you should be able to change the size of the current brush.
    • Modify your program to let you use tools. Some basic tools should be Pencil, Eraser, Brush, Rectangle, Ellipse, Triangle, Line.
    • Read this wikipedia to help you with ideas: http://en.wikipedia.org/wiki/Paint_program



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


    ~~AirWaves!!~~
    Thursday, October 27, 2011 7:06 AM

All replies

  • I found something some time ago: JHQ989

    • Edited by Jacob Brown Thursday, October 27, 2011 1:04 PM
    Thursday, October 27, 2011 1:04 PM
  •  

    I have no good sense of making songs.   

    But,   I made a song making program. PWL527    

    Octave Volume Pitch ....  you can change.

    Play repeat times  .... you can change

    Load ... previous song data is loaded in the textbox one after another.

    Save .... Save the code  showed in the textbox

    EXE..... Play repeat time and Save

    Erase .... Erase the code in the textbox

    Rest ....  Rest ( marks "." )

    delimiter...  "," is added.   but removed automatically when saving.   

    '  Do    Re      Mi     Fa      So      La     Ti
    '    C  D  E  F  G  A  B
    '     Do#Re#   Fa#   So# La#   Re♭   Mi♭  So♭  La♭  Ti♭
    '    C# D# F# G# A# D- E- G- A- B-
    '  On …Octave      Default=4  ;  Do    Re      Mi     Fa      So      La     Ti   Do  =  「O4 CDEFGAB O5 C」
    '    C8..... 8 half-steps
    '    , .,    .....Rest

    Friday, October 28, 2011 12:46 AM
    Answerer
  • Looks cool!
    ~~AirWaves!!~~
    Friday, October 28, 2011 7:54 PM
  • I'm submitting one for the easy challenge.
    Haven't done SB in a while, so I thought I'd go for that one.

    LFQ353

    Typing a number will move the turtle that amount. Typing "left" or "right" will rotate the turtle 45 degrees in those directions.

    I see some things I could add to make it smoother, but I'd rather not atm.

    • Edited by LMCSHERRY Friday, November 18, 2011 11:14 PM
    Friday, November 18, 2011 11:09 PM
  • Have tried your program and it is great! One thing though - have you got left and right mixed up? To me RIGHT should be clockwise but it seems to go anti-clockwise ... ?
    Wednesday, November 23, 2011 11:31 PM
  • Have tried your program and it is great! One thing though - have you got left and right mixed up? To me RIGHT should be clockwise but it seems to go anti-clockwise ... ?

    Whoops. Maybe I shouldn't try programming at 11PM? :P

    Also, I've revised it (it crashes Silverlight in my browser, though).

    Mediafire Download


    • Edited by LMCSHERRY Friday, November 25, 2011 11:13 AM
    Friday, November 25, 2011 11:12 AM
  • I have posted a modified solution for the easy challenge. ID is HXW748.

     

    Friday, November 25, 2011 11:27 AM
  • I submit another program for the challenge of the month.

    Solution for the intermediate challenge: KZQ654

    Saturday, November 26, 2011 9:26 AM
  • The first program i wrote for the beginner's challenge: QSC137.
    “Computers are like Old Testament gods: lots of rules and no mercy.” – Joseph Campbell
    Wednesday, November 30, 2011 11:11 AM
  • Be gentle on the criticism, its my first challenge.

    This one's for the easy challenge.  Press left to turn left, right to turn right, and escape to exit.

    SKF628

    Thanks,

     

    Allen



    edit* Oops, now that I try a different submission I see the point about input from the textwindow.
    • Edited by Allen Shmallen Wednesday, November 30, 2011 2:15 PM Addendum
    Wednesday, November 30, 2011 1:41 PM