Issues with mapping and lists

johnjanowskibsc

  • *
  • Posts: 153
Hi,

I have been struggling a little with an issue with maps.

Fir the game I am making I have used a map to store 11 teams (from a list) and points from a list. It works. I have been able to sort the list according to the points total.

However, when I want to empty the list and repopulate with a new set of team names and new points I have found that sporadically it will only store 10 teams not 11.

I have tried using other lists to populate the map but come across the same issue. I have attached the output issues and what they look like.

Has anyone come across this issue before and how did they solve it? Any help would be great!

Thanks

John


yoplalala

  • *
  • Posts: 1633
How many teams are there in League ?

I would set randomVal between  0  and the number of items in League.  (not 20)

Suppose you are not lucky and everytime you get a 20 from the random val
you'll have team20, then null , null, null   null ....



johnjanowskibsc

  • *
  • Posts: 153
I've changed the randomVal so when I've chosen the second team I am choosing from 19 teams, not 20 as one has gone from the list. However, this didn't make a difference as I was using a "repeat until team2 =not null" etc.

Its funny that it should work the majority of the time then occasional it decides to omit just one value but not insert any NULL values.

yoplalala

  • *
  • Posts: 1633
No I mean you should do randomVal to ( random integer between 0 and ( number of items in ( league))  and use blocks.
 
You should use the block null , not write "null" . ( Because it thinks it the text "null")

 

johnjanowskibsc

  • *
  • Posts: 153
Thanks for taking an interest and answering my question.

After lots of digging I found that the issue was in assigning the computer teams against my team. If my team was to be the last one chosen in the list then it removed a team from the league list...not sure why. I've just readjusted the upper limit to 1 less for my team. I've cycled through 30 new seasons and the bug hopefully has gone...

Just read this back and am pretty sure what I have just said doesn't make sense