code Radomize RRS feed

  • Question

  • Hey!

    I did some programs in Basic at the time Amiga computer existed. You can not use the Basic platform now with the new computers?

    Have tried to find toturials for small basic and there are many very good ones online.
    With the help of them, I have not succeeded in creating such a simple program that, with the Randomizecode of numbers 1 to 10, I get one of the numbers in that series to randomly appear on TextWindow.WriteLine.

    Here are some of the settings I tried with:

    For i = 1 to 10
    Random ()
         TextWindow.WriteLine (stripe)
       Sub Random
          edge = i

    The answer in this case is that the computer writes the numbers 1 to 10 chronologically in a row up in and down.

    The question is what is missing? Perhaps I can get some suggestions from Er.

    Karl-Arthur Hyllman.
    Tuesday, March 6, 2018 9:19 AM


All replies

  • Hi,

    Can you give the full code? Because I don't know the value the variable 'stripe'.


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

    Tuesday, March 6, 2018 3:00 PM
  • To get random numbers use Math.GetRandomNumber(10) which gives a number between 1 and 10 (inclusive)

    You have then to check if the next number is not already used.

    Jan [ WhTurner ] The Netherlands

    Tuesday, March 6, 2018 6:21 PM