none
help with school project?s RRS feed

  • Question

  • hey guys im pretty new to small basic,

    But hey it's fun!

     

    but now i need to make a thing for school and it goes like this: http://yfrog.com/m9smallbasicp

    i need to make this one but i don't now how... can someone help me PLZ

    this is the only thing i got

     For X = 60 To 400 Step 50

      GraphicsWindow.FillRectangle(X, 30, 30, 30)

    EndFor

    • Changed type litdevModerator Monday, October 11, 2010 8:59 PM This is a question
    Monday, October 11, 2010 1:46 PM

Answers

  • I recommend you to use 2 for loops to draw boxes. 1 loop for vertical boxes and another to horizontal boxes.

    Here is small sample but boxes are not in same size:

    GraphicsWindow.Show()
    GraphicsWindow.Width = 800'Set Window Size
    GraphicsWindow.Height = 600'Set Window Size

    'Draw Vertical Boxes
    For Y = 0 To 550 Step 50
      GraphicsWindow.BrushColor = "Green" 'Make Brush Color to Green
      GraphicsWindow.FillRectangle(0,Y,40,40)'Draw Green Box
      GraphicsWindow.BrushColor = "Blue"'Change Color to Blue
      GraphicsWindow.FillRectangle(750,Y,40,40)'Draw Blue Box
    EndFor

    'Draw Horizontal boxes
    For X = 50 To 700 Step 50
      GraphicsWindow.BrushColor = "Red"
      GraphicsWindow.FillRectangle(X,0,40,40)
      GraphicsWindow.BrushColor = "Yellow"
      GraphicsWindow.FillRectangle(X,550,40,40)
    EndFor


    Sorry My Bad English
    Monday, October 11, 2010 2:58 PM

All replies

  • I recommend you to use 2 for loops to draw boxes. 1 loop for vertical boxes and another to horizontal boxes.

    Here is small sample but boxes are not in same size:

    GraphicsWindow.Show()
    GraphicsWindow.Width = 800'Set Window Size
    GraphicsWindow.Height = 600'Set Window Size

    'Draw Vertical Boxes
    For Y = 0 To 550 Step 50
      GraphicsWindow.BrushColor = "Green" 'Make Brush Color to Green
      GraphicsWindow.FillRectangle(0,Y,40,40)'Draw Green Box
      GraphicsWindow.BrushColor = "Blue"'Change Color to Blue
      GraphicsWindow.FillRectangle(750,Y,40,40)'Draw Blue Box
    EndFor

    'Draw Horizontal boxes
    For X = 50 To 700 Step 50
      GraphicsWindow.BrushColor = "Red"
      GraphicsWindow.FillRectangle(X,0,40,40)
      GraphicsWindow.BrushColor = "Yellow"
      GraphicsWindow.FillRectangle(X,550,40,40)
    EndFor


    Sorry My Bad English
    Monday, October 11, 2010 2:58 PM
  • awesome man tnx it really helped me out :D
    Monday, October 11, 2010 3:18 PM
  • hey man tnx for all i think its allright now because i changed a bit of the code and now it will do (i think :P)

     

    GraphicsWindow.Show()

    GraphicsWindow.Width = 800

    GraphicsWindow.Height = 600

     

    'horizontale vierkanten

    For X = 55 To 400 Step 50

      GraphicsWindow.BrushColor = "Red"

      GraphicsWindow.FillRectangle(X,0,40,40)

      GraphicsWindow.BrushColor = "Yellow"

      GraphicsWindow.FillRectangle(X,400,40,40)

    EndFor

     

    'verticale vierkanten

    For Y = 0 To 400 Step 50

      GraphicsWindow.BrushColor = "Green"

      GraphicsWindow.FillRectangle(0,Y,40,40)

      GraphicsWindow.BrushColor = "Blue"

      GraphicsWindow.FillRectangle(410,Y,40,40)

    EndFor

    Monday, October 11, 2010 3:34 PM