# Challenge of the Month - February 2018

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

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

Turtle Challenge

Get the turtle to draw one or more of the following shapes:

• Square
• Circle
• Ellipse
• 5 pointed star
• Kite
• Rhombus
• Hexagon
• Equilateral tringle

Graphics Challenge

Write a program to draw a famous bridge

Maths Challenge

Write a program to calculate the probablility of getting a combined score of 7 when throwing two normal six sided dice.

Game Challenge

Write a simple 2 player snap game, where the computer shuffles, deals and does all the game play.  The two players only have to be first to press their keyboard key when a pair is shown to win the current stack.  The winner as usual is the first to get all the cards.

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

Thursday, February 1, 2018 6:47 PM

### All replies

• This is my solution for Square, Kite and Rhombus in Turtle Challenge: NKL035.

Nonki Takahashi

Friday, February 2, 2018 6:47 AM
• This is my solution for Equilateral triangle in Turtle Challenge: CLJ375.

Nonki Takahashi

Friday, February 2, 2018 6:50 AM
• This is my solution for Graphics Challenge: VWN481.

Nonki Takahashi

Friday, February 2, 2018 7:55 AM
• This is my solution for the Maths Challenge. p[7] is the answer.

```' Dice Probability
For d1 = 1 To 6
For d2 = 1 To 6
score = d1 + d2
case[score] = case[score] + 1
total = total + 1
EndFor
EndFor
For score = 2 To 12
p = Math.Round(case[score] / total * 1000) / 10
TextWindow.WriteLine("p[" + score + "]=" + p + "%")
EndFor
```
```p[2]=2.8%
p[3]=5.6%
p[4]=8.3%
p[5]=11.1%
p[6]=13.9%
p[7]=16.7%
p[8]=13.9%
p[9]=11.1%
p[10]=8.3%
p[11]=5.6%
p[12]=2.8%```

Nonki Takahashi

Friday, February 2, 2018 10:09 AM
• I wrote a simulator for the Math Challenge also: MDB491-1.

Nonki Takahashi

Friday, February 2, 2018 10:14 AM
• Hi Team,

HNZ647 - Turtle square.

Thanks,

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

Friday, February 2, 2018 1:26 PM
• Maths Challenge    VQT172

Friday, February 2, 2018 2:06 PM
• Haven't posted in a while, but I had an idea for a challenge:

Write a program to undistort a barrel distorted image (fish eye). This should be done without any extensions.

Example of a barrel distorted image: http://www.btobey.com/learn/images/barrel-distortion.jpg

It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

Friday, February 2, 2018 7:19 PM
• This is my solution for the game challenge: SWW693.

Nonki Takahashi

Wednesday, February 7, 2018 11:46 AM
• LQZ137 hearts:

Thursday, February 8, 2018 9:36 PM
• This is my solution for the 5 pointed star in the turtle challenge: GKC975.

Nonki Takahashi

Friday, February 16, 2018 4:10 AM