sticky
Challenges RRS feed

  • General discussion

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

    Over the last few monthly challenges, there have been reducing replies.  This may be due to me struggling to introduce new challenge ideas capturing interest without being repetitive.

    Therefore, for a while I suggest the community at large suggest challenges as we have ideas, hopefully invigorating new perspectives and challenges/discussions.

    So, open forum for any challenges or programming discussions.

    Monday, April 1, 2019 7:57 PM
    Moderator

All replies

  • Challenge 1:

    array[1] = "YouTube"
    array[2] = "Programming"
    array[3] = "You"
    array[4] = "Professional"
    array[5] = "Life"

    Order this array in alphabetical order (A - Z) through algorithms


    Roshan - 8th Grade Student (Age 13) - Learning Learning Python, Machine Learning and C#

    Tuesday, April 2, 2019 3:28 AM
  • Hi Roshan, I once wrote subroutines for text compare.  I'd like to try Challenge 1 with the subroutines.

    GitHubGist Small Basic Text Compare


    Nonki Takahashi

    Thursday, April 4, 2019 10:43 PM
    Moderator
  • This is my solution for the Challenge 1: CSH007-0.

    Life
    Professional
    Programming
    You
    YouTube
    Press any key to continue...

    Nonki Takahashi



    Friday, April 5, 2019 12:18 AM
    Moderator
  • This is my solution for the Challenge 1: CSH007-0.

    Life
    Professional
    Programming
    You
    YouTube
    Press any key to continue...

    Nonki Takahashi



    Nice Work!

    Roshan


    Monday, April 8, 2019 10:44 AM
  • Challenge 2 :

    Get the index of a value in an array.


    Roshan 

    Monday, April 8, 2019 10:48 AM
  • There are several ways you might search for value(s) in an array, like:

    1.) Only show 1st occurance (or all)?

    2.) Case(in)sensible?

    3.) Trimmed value or does value-element contain the searched value etc.

    Applied 1.) and 2.) in SPT104 by boolean flags 'allIdcs' and/or 'valCaseInsens'.

     

    Monday, April 8, 2019 12:09 PM
    Answerer
  • This is my challenge idea:

    Graphics Challenge

    Write a program to draw your favorite pictogram.


    Nonki Takahashi

    Wednesday, April 10, 2019 9:35 AM
    Moderator
  • This is my solution for the graphics challenge: PPT955-0.

    Screen shot of a program Pictogram - Handicapped Accesible Sign


    Nonki Takahashi


    Wednesday, April 17, 2019 8:58 AM
    Moderator
  • This is my solution for the challenge 2:

    arry["Spring"] = "Blue" 
    arry["Summer"] = "Red"
    arry["Autumn"] = "White"
    arry["Winter"] = "Black"
    
    value = "Red"
    Array_GetIndex()
    TextWindow.WriteLine(index)
    
    Sub Array_GetIndex
      ' param arry - array
      ' param value - value
      ' return index - if found
      nArry = Array.GetItemCount(arry)
      indices = Array.GetAllIndices(arry)
      For iArry = 1 To nArry
        index = indices[iArry]
        If arry[index] = value Then
          iArry = nArry ' exit For
        Else
          index = ""
        EndIf
      EndFor
    EndSub


    Nonki Takahashi

    Wednesday, April 17, 2019 9:28 AM
    Moderator
  • This is my idea for Super Challenge to participate development for SBO v1.0 (C# version).

    SBO v1.0 will be next base of Small Basic.  SBO itself is still for new programming learners.  But after learning SBO programming, you can learn SBO inside to know how your SBO programs run.  Because SBO is open source.  Through SBO source code and the process of developing, you will learn hot technologies such like Blazor about .NET Framework.


    Nonki Takahashi


    Monday, May 27, 2019 6:48 AM
    Moderator
  • This is another idea for Game Challenge:

    Write a program to generate Sudoku puzzle.

    (I made a thread for it.)


    Nonki Takahashi

    Wednesday, June 19, 2019 2:31 PM
    Moderator
  • Small challenge:

    Write 10-line (or less) elegant program!


    Nonki Takahashi


    Wednesday, July 31, 2019 1:19 PM
    Moderator
  • Conversion Challenge:

    Convert a C# or VB.NET game to a Small Basic program.  cf. There are many games in TechNet Wiki.


    Nonki Takahashi

    Sunday, August 4, 2019 1:59 AM
    Moderator
  • Study Challenge

    Study something using Small Basic.  For example, Sudoku Challenge is also Sudoku studying with Small Basic.


    Nonki Takahashi

    Sunday, August 18, 2019 8:18 AM
    Moderator
  • Graphics Challenge:

    Draw a spider web picture.


    Nonki Takahashi


    Saturday, October 5, 2019 3:26 AM
    Moderator
  • Graphics Challenge:

    Draw a spider web picture.


    Nonki Takahashi


    This is my first step: QLG339.

    Screen shot of a program Web 0.1


    Nonki Takahashi

    Saturday, October 5, 2019 9:56 AM
    Moderator
  • This is my second step: QLG339-0.

    Screen shot of a program Draw Web 0.2


    Nonki Takahashi

    Saturday, October 5, 2019 10:03 AM
    Moderator
  • Conversion Challenge:

    Convert a C# or VB.NET game to a Small Basic program.  cf. There are many games in TechNet Wiki.


    Nonki Takahashi

    This is my solution for Conversion Challenge: GMV958-0.

    Screen shot of a program MasterMind


    Nonki Takahashi

    Monday, October 7, 2019 4:14 AM
    Moderator
  • This is new super challenge idea.

    Editor Challenge

    Write a program to edit table.  Input will be keyboard and mouse.  Output will be markdown table text and the rendered table graphics.

    Sample markdown:

    |Table Heading 1|Table Heading 2|
    |---|---|
    |Row 1-Cell 1|Row 1-Cell 2|
    |Row 2-Cell 1|Row 2-Cell 2|

    Sample graphics:

    table graphics


    Nonki Takahashi



    Saturday, October 19, 2019 4:08 AM
    Moderator
  • First version of the graphical output:

    GraphicsWindow.Top=10
    a[1]="|heading 1|heading 2|heading 3|"
    a[2]="|field 11|field 12|field 13|"
    a[3]="|field 21|field 22|"
    a[4]="|field 31|field 32|field 33|"
    x0=15  ''position in window
    y0=20
    wid=360  '' table width
    hgt=25   '' field height
    
    For i=1 To Array.GetItemCount(a)
      posY=y0+hgt*(i-1)
      GraphicsWindow.DrawLine(x0,posY,x0+wid,posY)
      fld=LDText.Split(a[i],"|")
      If i=1 Then
        fldC= Array.GetItemCount(fld)
        fldW=wid/(fldC)
      EndIf
      GraphicsWindow.DrawLine(x0,posY,x0,posY+hgt)
      
      For j=1 To fldC
        GraphicsWindow.DrawLine(x0+fldW*(j),posY,x0+fldW*j,posY+hgt)
        GraphicsWindow.DrawText(10+x0+fldW*(j-1),posY+5,fld[j])
      EndFor
    EndFor
    GraphicsWindow.DrawLine(x0,posY+hgt,x0+wid,posY+hgt)
    

    What do you want with the   |--|--|   line?


    Jan [ WhTurner ] The Netherlands

    Saturday, October 19, 2019 12:56 PM
    Answerer
  • updt to nonki's webcob: ZQG995

    • added spider
    • added spider jumps

    Saturday, October 19, 2019 6:34 PM
  • updated Jan's table: ZNK538

    • added alignment codes
    • added colouring
    • different columns width allowed
    • removed lines
    • added zoom with mswheel

    Sunday, October 20, 2019 6:38 AM
  • What do you want with the   |--|--|   line?


    Jan [ WhTurner ] The Netherlands

    Hi WhTurner, | --- | --- | means the separator between table header and contents.

    cf. https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables


    Nonki Takahashi

    Sunday, October 27, 2019 9:25 AM
    Moderator
  • This is my new idea for challenges.  I made a thread for this challenge.  Thanks.

    Chemistry Challenge

    Write a program to draw a molecular structure.


    Nonki Takahashi

    Saturday, November 16, 2019 4:09 AM
    Moderator