none
Challenge of the Month - January 2018 RRS feed

  • General discussion

  • Happy New Year!

    These 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.

    We may extend these challenges over into a second month if solutions and questions are still coming in.

    Text Challenges

    • Write a program to read 2 numbers from the TextWindow and then output a line saying which number is the largest, for example 2 and 7 entered gives "7 is greater than 2"
    • Write a program to read 2 letters from the TextWindow and output all letters (inclusive) in the alphabet between the 2 letters entered, for example d and l entered gives "defghijkl"

    Graphics Challege

    • Write a program to draw snow flakes - ideally they should have symmetry in 6 directions (hexagonal symmetry) and each one should be unique, using random numbers in some way.

    Snowflakes Icon Collection Vector | Free Vector Graphics ...

    Calendar Challenge

    • Write a calendar program that shows the days in each month for 2018
    • Include buttons to move between the months
    • Add Flickr images appropriate for each month - change the image each time you display a month

    http://calendarholidays.xyz/national/wp-content/uploads/2017/07/August-2017-Excel-Calendar.jpg

    Game Challenge

    • I wrote a starting point for an arcade style shooting game, import NTG546
    • It incliudes a basic game structure, mouse and keyboard entry, bullets and bombs with collision detection
    • The challenge is to take this basic strcture and turn it into a proper game
    • Consider if you want mouse or keyboard control, images and background, levels with increasing difficulty, special effects, sound, scoring etc.  The most important thing is a fun and engaging game play.

    Community Suggetsions (By Roshan)

    • Write a program that can load all variables (even which are used in for loop) of a file with (.sb) extension.
    • Make a simple colour slider that can select colours

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

    Monday, January 1, 2018 6:33 PM
    Moderator

All replies

  • Hi Team,

    This is my solution for the Game challenge.

    Link = https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Screen shot

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, January 2, 2018 6:32 AM
  • Hi Team,

    This is my solution for first one of text challenges

    Import code = PHK448

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, January 2, 2018 6:44 AM
  • Hi Team,

    This is my solution for second one of text challenges

    Import Code = RRK490

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, January 2, 2018 6:51 AM
  • For fun I made a simple color slider tool:  HDQ078

    Tuesday, January 2, 2018 8:15 AM
  • @ Roshan

    Great start to the shooting game - some further challenges would be to move the enemies differently to maybe advance down, maybe levels so it starts easier/slower/fewer enemies etc. 

    If you use png images rather than jpgs they can have transparency. 

    Be inventive and change it as you want - the sample was just a starting point to get a basic structure.

    Try to keep the code structure clean (comments, subroutines etc), for example the sound and blast images etc could be in Initialise() and the OnTimer event sub could be with the other event subroutines.

    Your battle music is 241 seconds long, not 70, and I would do the music restart before the game loop delay, in case restarting music takes longer and we get a noticeble drop in fps.

      'Update background music
      If (startMusic) Then 'Start and stop must on UI thread, NOT inside an event
        startMusic = "False"
        Sound.Stop(musicFile) 'Stop must first - allows it To be started from the beginning
        Sound.Play(musicFile)
      EndIf
      
      'Delay the game To try To maintain even 50 frame per second (fps)
      delay = 20-(Clock.ElapsedMilliseconds-start)
      GraphicsWindow.Title = delay 'To check For performance issues While testing
      If (delay > 0) Then
        Program.Delay(delay)
      EndIf

    These are really minor points and sounds a bit picky, but you are progressing really well and I wanted to give a bit more detailed feedback.

    First text challenge works great, only other thing would be to handle the case when they are the same.

    For the second text challenge when I enter d first then l I get DEFGHIJKLMNO, and when I enter l first then d I get LMNO.

    @ Brian

    Nice color slider, I like using onMouseDown to call onMouseMove to just handle a single click without movement.

    Tuesday, January 2, 2018 11:46 AM
    Moderator
  • @ Roshan

    Great start to the shooting game - some further challenges would be to move the enemies differently to maybe advance down, maybe levels so it starts easier/slower/fewer enemies etc. 

    If you use png images rather than jpgs they can have transparency. 

    Be inventive and change it as you want - the sample was just a starting point to get a basic structure.

    Try to keep the code structure clean (comments, subroutines etc), for example the sound and blast images etc could be in Initialise() and the OnTimer event sub could be with the other event subroutines.

    Your battle music is 241 seconds long, not 70, and I would do the music restart before the game loop delay, in case restarting music takes longer and we get a noticeble drop in fps.

      'Update background music
      If (startMusic) Then 'Start and stop must on UI thread, NOT inside an event
        startMusic = "False"
        Sound.Stop(musicFile) 'Stop must first - allows it To be started from the beginning
        Sound.Play(musicFile)
      EndIf
      
      'Delay the game To try To maintain even 50 frame per second (fps)
      delay = 20-(Clock.ElapsedMilliseconds-start)
      GraphicsWindow.Title = delay 'To check For performance issues While testing
      If (delay > 0) Then
        Program.Delay(delay)
      EndIf

    These are really minor points and sounds a bit picky, but you are progressing really well and I wanted to give a bit more detailed feedback.

    First text challenge works great, only other thing would be to handle the case when they are the same.

    For the second text challenge when I enter d first then l I get DEFGHIJKLMNO, and when I enter l first then d I get LMNO.

    Hi,

    I have published 2nd one of text challenges with no issues.

    Import code = SJW044

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, January 2, 2018 2:26 PM
  • Hi Team,

    I have also updated the game challenge

    https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Features :

    • Converted all images to .png
    • Updated timer event
    • Fixed collision detection

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Tuesday, January 2, 2018 2:39 PM
  • Hi,

    I have published 2nd one of text challenges with no issues.

    Import code = SJW044

    can you also get it to work when entering l then d
    Tuesday, January 2, 2018 2:50 PM
    Moderator
  • not a really slider but also interesting picker tool: WMR425

    just move mouse over colors to read color values

    Wednesday, January 3, 2018 8:19 AM
  • Hi,

    I have published 2nd one of text challenges with no issues.

    Import code = SJW044

    can you also get it to work when entering l then d

    Hi,

    I have published 2nd one of text challenges with no issues. Import code = JMG807

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Wednesday, January 3, 2018 11:03 AM
  • Hi Team,

    This is my color slider.

    Import Code = FTB321

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Wednesday, January 3, 2018 11:26 AM
  •  Happy New Year 2018 VHS349                                                                       mahreen miangul
    Wednesday, January 3, 2018 11:56 AM
  • also same with different arrangement: RBG750

    Wednesday, January 3, 2018 12:01 PM
  •  Color Slider Happy new year 2018: RQP692 with thanks and Guidence from Brian Broker   
                                                                                                                                        mahreen miangul        
    Wednesday, January 3, 2018 12:15 PM
  • Happy New Year!

    This is my first solution in 2018 for the graphics challenge: ZBG645.

    Screen shot of a program Snow Flakes


    Nonki Takahashi


    Thursday, January 4, 2018 2:32 PM
    Moderator
  • Hi Team,

    This is my solution for the Game challenge.

    Link = https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Screen shot

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Hi Team,

    Updated shooting game.

    https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Features :

    • Added unlimited levels

    • Fixed bugs

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Friday, January 5, 2018 11:55 AM
  • gr8 flakes nonky))

    small upd:   ZBG645-0

    • bicolor flakes
    • zoom/tilt by msheel


    • Edited by Tryhest Sunday, January 7, 2018 9:43 PM
    Sunday, January 7, 2018 9:42 PM
  • street with house numbers: XHF046

    Tuesday, January 9, 2018 10:14 PM
  • Hi Team,

    Updated shooting game.

    https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Features :

    • Added unlimited levels

    • Fixed bugs

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#

    Hi Team,

    Updated game

    https://gallery.technet.microsoft.com/Small-Basic-Shooting-Game-bdeec54f

    Features :

    • Bullet is removed when you go to next level.
    • Bug fixes

    Thanks,


    Roshan - 7th Grade Student (Age 12) - Learning Small Basic, Visual Basic and C#


    Thursday, January 11, 2018 11:36 AM
  • This is my solution for the calendar challenge: RQD767.

    Screen shot of a program Calendar with Flickr Pictures

    Original photo by Егор Журавлёв (CC BY-SA 2.0)


    Nonki Takahashi


    Friday, January 12, 2018 10:41 AM
    Moderator
  • This is my solution for the game challenge: XHJ686.

    Screen shot of a program Space Shooter


    Nonki Takahashi

    Tuesday, January 16, 2018 2:15 PM
    Moderator
  • Text Challenge

    TextWindow.WriteLine("Enter a letter")
    val1 = Text.GetCharacterCode(Text.ConvertToLowerCase(TextWindow.Read()))
    TextWindow.WriteLine("Enter a letter")
    val2 = Text.GetCharacterCode(Text.ConvertToLowerCase(TextWindow.Read()))
    
    For i = Math.Min(val1,val2) To Math.Max(val1,val2)
      TextWindow.Write(Text.GetCharacter(i))
    EndFor
    TextWindow.WriteLine("")

    Thursday, January 18, 2018 8:32 PM
    Moderator
  • This is my solution for the second challenge of the community suggestions: TLF750.

    Screen shot of a program Simple Color Slider


    Nonki Takahashi

    Saturday, January 20, 2018 11:35 PM
    Moderator