this is an IFS fractal generator using an algorithm known as Chaos Game. Restriction types: 0: any point may be chosen; unrestricted 1: the same point may not be chosen twice. 2: if a point is chosen twice, the next chosen point must not be a direct neighbor in the list. 3: the next chosen point must not be one point away backwards in the list. 4: a new point must be chosen at least twice.
everything I used to understand Chaos Game: https://math.hws.edu/eck/js/chaos-game/chaos-game-info.html https://math.bu.edu/DYSYS/chaos-game/node1.html https://www.maa.org/sites/default/files/pdf/upload_library/2/Devaney%202005.pdf https://beltoforion.de/en/recreational_mathematics/chaos_game.php https://en.wikipedia.org/wiki/Chaos_game