none
My first SB program - a few questions RRS feed

  • Question

  • Hi

    I have been evaluating Small Basic as a teaching aid for 11-14 year olds and so far I am very impressed!

    To get myself up to speed I have written a small program along the lines of 'Bulls and Cows' and 'Mastermind'. The code is not elegant and a little messy in places, not to mention uncommented but it does work!

    Import ID JTB646, Browser Version http://smallbasic.com/program/?JTB646

    A couple of questions -

    1. Everything looks as it should when run from the desktop but when I run it in a browser the circles and squares do not have a black outline as they do on the desktop and I have no idea why. Any ideas?

    2. The 'Instructions' button works when run from the desktop but not from a browser. Can SB programs not open an alert window from a browser? If so then is there an alternative method?

    3. Does Small Basic support functions? i.e. a new function that can take a parameter and return a value?

    Many thanks for any replies!





    • Edited by rubikWizard Wednesday, June 1, 2011 10:56 PM Q3 added
    Wednesday, June 1, 2011 10:14 PM

Answers

  • Nice game - Basically, the SilverLight implementation of SmallBasic is imperfect (not identical to the desktop version) - there are a number of limitations such as drawing and positioning shapes are sometimes not identical and clearly File operations and it appears Alert windows - also Events can get out of sequence or behave strangely.  As far as I know this is just how it is - some games have ported fine to the web (sometimes slightly visually different to the desktop version) - perhaps it took more work to get them looking good in a browser?

    Apart from the instructions, the game basically works well in a browser, perhaps an intro page or if you feel the need a redraw of the graphics window with instructions and return to the game when done with the instructions, or put the instructions in a TextWindow - I think you can have both on the browser version.

    Good Luck.

    For other SB users, uploaded programs can be viewed on the web using the publish ID, for example: http://smallbasic.com/smallbasic.com/program/?JTB646

    Wednesday, June 1, 2011 10:57 PM
    Moderator

All replies

  • Nice game - Basically, the SilverLight implementation of SmallBasic is imperfect (not identical to the desktop version) - there are a number of limitations such as drawing and positioning shapes are sometimes not identical and clearly File operations and it appears Alert windows - also Events can get out of sequence or behave strangely.  As far as I know this is just how it is - some games have ported fine to the web (sometimes slightly visually different to the desktop version) - perhaps it took more work to get them looking good in a browser?

    Apart from the instructions, the game basically works well in a browser, perhaps an intro page or if you feel the need a redraw of the graphics window with instructions and return to the game when done with the instructions, or put the instructions in a TextWindow - I think you can have both on the browser version.

    Good Luck.

    For other SB users, uploaded programs can be viewed on the web using the publish ID, for example: http://smallbasic.com/smallbasic.com/program/?JTB646

    Wednesday, June 1, 2011 10:57 PM
    Moderator
  • Thanks for your reply litdev!

    Some good info there! I am not really wanting to improve the game in any way (much) - it was just a little mini-project for me to get used to Small Basic so that I am confident in teaching it to students at my school. I have to say that it is a great environment for beginners to use, especially the publish/import features (although these will not work through our school proxy server)

    I have to say that the algorithm that I used to compute the results of each attempt at the code was adapted from an old version of a similar game on my Commodore 64 (the C64 BASIC was written by Microsoft anyway!). I think it came from an original Commodore book or demo disk.

    Small BASIC really does put the FUN back into programming like it was in the 80s! I have really enjoyed writing this program.

    I hope SB goes from strength to strength and engages a whole new generation of kids into problem solving and programming.

     

     

    Wednesday, June 1, 2011 11:20 PM
  • I also started playing with a Spectrum in the 80s and like the feel that SB has, where only a few commands need to be learned to achieve results.  Too many other languages are so bloated with syntax and methods that the learning of the basic ideas is a real challenge and not as much fun as it should be for people picking it up for the first time.

    About functions - there has been much discussion in the past about whether function arguments would help.  This would change the simplicity of global variable scope - I tend to agree that global scope in its entirety keeps things simple and function arguments would cause more confusion than it solves, however others disagree.

    It it relatively easy to write .Net extensions in VB or C# to add specific features and these do take arguments.

    Saturday, June 4, 2011 7:03 PM
    Moderator
  • I would love to have functions... Vijaye Raji or hows the name... could make Small Basic have another button on top of IDE, a button to either use Small Basic in simple mode, what it currently is and Advanced mode with few extra stuff like functions and similar. That would be great i bet.
    I love game design and game programing.
    Sunday, August 28, 2011 9:40 AM