Computer Science Canada

Jezzball Help - Arrays

Author:  Mr. T [ Mon Oct 17, 2005 5:50 pm ]
Post subject:  Jezzball Help - Arrays

I incorporated an array of coordinates for the creation of walls...but the array does not seem to add an new element to itself, even though I used the new function. Can anyone figure out why?

Author:  bass_maniac [ Tue Oct 18, 2005 11:57 am ]
Post subject: 

This would be because you are using the 'upper' command. With 'new' you don't need to.

Instead of
code:
new name, upper (name) + 1

just put
code:
new name, newUpper

You'll need to make an variable to hold the value of newUpper. Here's what I added:

At the top,
code:
var increase := 0

in wall creation,
code:
if left = 1 and whatdotcolour (barX, barY) not= blue then
            a := 0
            b := 0
            button := 0
            increase += 1
            new boxArray, increase

Author:  [Gandalf] [ Tue Oct 18, 2005 2:38 pm ]
Post subject: 

Not quite, upper(array) + 1 will give the same result, cause less clutter and make the program more efficient.

Author:  Mr. T [ Tue Oct 18, 2005 8:49 pm ]
Post subject:  Alex's Opinion

Anyways, any solutions to my original post?


: