-
-
processing code for this >:)https://gist.github.com/beesandbombs/2116bf6a818f54368af6feb4a3b30c9f …
1 vastaus 1 uudelleentwiittaus 35 tykkäystäNäytä tämä ketju -
Vastauksena käyttäjälle @beesandbombs
stroke(cs[(q+101)%3]); Why not? stroke(cs[(q+2)%3]); ?
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @v_dobler
because q is negative sometimes, and % works weird for negatives, i add a big number just to be safe
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @beesandbombs
The result of % has the same sign as the number to the left of it. To be sure of getting an correctly signed value between 0 and 3(exclusive) you can use abs(q)%3.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @v_dobler
this doesn't do what I need unfortunately. see crude plot! black = raw %, red = % with abs, blue = % with +100 shift see how abs makes it flip in the middlepic.twitter.com/cV0EcbCCA5
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @beesandbombs
How about ((q%3)+3)%3? I tried to simulate the weird behaviour you mentioned in Python. I've encountered it somewhere too. I quests C# has an strange mod operator. And the solution above did it for me.
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
sure that does it. but i'm more likely to remember q+100 :)
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.