Drawing random numbers without duplicates [SOLVED]

This forum is currently in read-only mode.
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hi all :)

    I have small problem with some events, loops and arrays.

    <font size="1">h**p://i.imgur.com/BqJEAs6.jpg

    I need to draw 5 unique numbers and store them in array (that's job for "losowanko" loop), and every time a number is drawn, "sprawd" loop should check if it's unique, by comparing it to previous array records.

    Well, and here comes the problem: it doesn't work.

    I mean, it draws numbers ok, but when record is duplicate it just draws next instead of replacing it with new number (and checking it of course). Once duplicate counter hits 2 or 3, "losowanko" loop seems to end or break.

    Any ideas what's wrong with my events? I've spent last 4 hours trying to solve that, and nothing :(

    'y' variable is 5 if it changes anything.</font>


    After spending another 3 hours I've finally got it by making completely different set of events.

    If there is anything I can make simpler or faster, please share your tips :)

    Cap with explanations:

    Cap me tender

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)