Use TURBO mode to see the demonstration pattern. (Press the <Shift> key and click the Green Flag for TURBO mode). The "1 Line Challenge" is to produce an interesting pattern using only ONE line of code to calculate the color of each pixel. YOU MAY ONLY CHANGE THE "set pen color to ..." LINE IN THIS PROJECT TO MEET THE CHALLENGE! "See Inside" for more Rules, Rewards, Tutorials etc. Please put your remixed "1 Line Challenge" Projects in the Studio https://scratch.mit.edu/studios/2825709/ If you just had to break the rules please put your "Not Quite A 1 Line Project" projects in this studio instead https://scratch.mit.edu/studios/2825759/
This has to be the longest line of code I've ever written... Idea : map x to [-0.5; 0.5] : x = x / 480 map y to |-0.5; 0.5] : y = y / 360 let r = sqrt(x² + y²) let a = atan(|y / x|) if y != 0 ; 0 if y = 0 let b = atan(|x / y|) if x != 0 ; 0 if x = 0 Now let R = 127.5 * r^[sin(a)] * cos(a) % 255 let G = 127.5 * r^[sin(b)] * cos(b) % 255 let B = 127.5 * r^[sin(a)] * sin(a) % 255 Then these give the RGB values of the pixel. Now imagine writing all that in a single line with no variables !