The reason you end up with the same value for each item in the array is because of this:
Quote: "
FOR i = 1 TO 10
Scores(i) = Score
next i
"
What you're doing here is taking "score" and assigning it to each array item and that's why they're the same. Here's a quick little something I boiled up. Copy it and paste it into your editor. Read through it and run it. It'll give you more or less all you need on arrays for this assignment:
` Basics on Arrays
` ================
` If you see a line beginning with "HELP = 1", ignore it, it prints help during program execution.
`
`Just colour constants, nothing to worry about
#CONSTANT noir RGB(0,0,0)
#CONSTANT blou RGB(50,50,250)
#CONSTANT wit RGB(240,240,240)
#CONSTANT groen RGB(50, 200, 50)
`Our array will be dimensioned as 1 initially. There are actually 2 items in this object: MyArray(0) and MyArray(1)
DIM MyArray(1)
`Print intro
INK wit, noir
PRINT "Welcome to My world, hahaha!"
PRINT " "
PRINT "Today we'll deal with those annoying things"
PRINT "called ARRAYS. We'll be doing this at quite"
PRINT "basic level (better understanding)."
PRINT " "
PRINT "Sit back and relax."
`Set array counter, which I've creatively named "counter"
counter = 0
GetInput:
PRINT " "
INPUT "Input any value you like (0 will exit):> ", anyval
`Check if the counter has exceeded 1. If so,
IF counter > 1
`increase the number of items in the array by 1 to make space for the next input.
ARRAY INSERT AT BOTTOM MyArray()
HELP = 1: INK blou, noir: PRINT "IF ";: INK wit, noir: PRINT "counter > 1 ";: INK blou, noir: PRINT "ARRAY INSERT AT BOTTOM ";: INK wit, noir: PRINT "MyArray()": INK groen, noir: PRINT "What's been done above? We increased": PRINT "the number of items in the array by": PRINT "one to make space for the next input": INK wit, noir
ENDIF
`Assign the latest value to the latest array index
MyArray(counter) = anyval
`If 0 was given as an input,
IF anyval = 0
`remove the latest array item. This is just to demonstrate the command, in reality, you'd avoid creating it in most circumstances.
ARRAY DELETE ELEMENT MyArray(), counter
HELP = 1: INK blou, noir: PRINT "IF ";: INK wit, noir: PRINT "anyval = 0": INK blou, noir: PRINT " ARRAY DELETE ELEMENT ";: INK wit, noir: PRINT "MyArray(), counter"
ELSE
`Otherwise (IF NOT anyval = 0), INCrease counter by 1, jump back to GetInput (I just used GOTO because it was easier to read in this eg)
HELP = 1: INK blou, noir: PRINT "IF NOT ";: INK wit, noir: PRINT "anyval = 0": INK blou, noir: PRINT "INC ";: INK wit, noir: PRINT "counter": INK blou, noir: PRINT "GOTO ";: INK wit, noir: PRINT "GetInout"
INC counter
GOTO GetInput
ENDIF
`So if 0 was entered, program continued to flow, we arrived here:
`Now it's just a case of printing out the array contents after the wait key prompt
INK wit, noir
PRINT " "
PRINT "Looks like that's that. Press any key..."
WAIT KEY
CLS
PRINT "This was stored in the array, MyArray():"
PRINT " "
`ARRAY COUNT is very useful I could have used the counter variable (and subtracted 1 in this example) but
`I chose to use this because it doesn't depend on a tracking variable and will always give you the most
`accurste reading.
FOR i = 0 TO ARRAY COUNT(MyArray())
PRINT MyArray(i)
NEXT i
PRINT "... And that's the most basics of arrays"
PRINT " "
PRINT "Press any key to exit..."
WAIT KEY
`We don't need this at the end of the program but good habbits should be maintained as you'd kill arrays
`during the program once they weren't needed - Save The Resources Campaign
UNDIM MyArray()
END
`It's the end of the programz :O