Skip to content
← Back to Community
Python 'Skittles' One-liner
Profile icon
MaxwellGarner

Skittles One-Liner

Oh my god we hit the Popular page, I honestly don't know how or why, I only posted this so my friends could see it lmao. Full functionality -- fork the program and change the first few variables in the very first line's 'line' iykwim


Something stupid my friends made, printing "taste the rainbow" in color. I added some functionality and compressed it to one line. (It does not loop forever anymore, but it does loop quite long enough.) My friends and I will be messing around with it, so what you see might not be the actual product, so fork it and play with it yourself!

There's some config variables at the very front so if you wanna fork it and play around, have fun!


My first one-liner -- Python control statements using indentation instead of braces made it hard, but it's done! Tell me how I should improve it!
Edit: I made another one-liner check it out 0w0

Edit: Added code explanation below main function. Glad you all like it!

Another edit: All of the people I showed in-person were confused how the fading works, so I added an explanation below the other explanations. Also, ASCII art is love, ASCII art is life

Voters
Profile icon
P0GCHAMPB0i
Profile icon
angrydoge
Profile icon
Dedf1sh08
Profile icon
Kgbadz
Profile icon
SAO10
Profile icon
Nettakrim
Profile icon
CoalSephos
Profile icon
SquareSquidward
Profile icon
QuincySullivan
Profile icon
Tacostorm2
Comments
hotnewtop
Profile icon
WILLIAMBAEWER

it tastes like chicken

Profile icon
MaxwellGarner

@WILLIAMBAEWER Chicken flavored skittles sounds concerning

Profile icon
JacobMcPherson1

@WILLIAMBAEWER THAT SOUNDS DELICIOUS

Profile icon
OldWizard209

@rafrafraf rn:

image

Profile icon
rafrafraf
Profile icon
Whippingdot
Profile icon
AIDANGREEN6

Ahem... My homework.... (It's supposed to be a dinosaur.... You can see how skilled I am by just looking at it.)

____ | 0 |___ | ___| | | | |__ | __) | |
Profile icon
mrslep

@AIDANGREEN6 how did you make the dinosaur in its own line
not like this
not like this

Profile icon
AIDANGREEN6

@srsly I actually didn't realize he was in his own line- Now it looks stupid with his feet below.

Profile icon
AIDANGREEN6

@srsly I didn't do anything fancy- put 6 spaces before each section to move it to the side maybe?

___ | 0 0| | u |

Did that do it? If not, I have no clue.
Unless highlighting and pressing tab...


| 0 0|
| w |
| _ |
|| ||

Profile icon
AIDANGREEN6

@srsly ok, so it was the 6 spaces before each line.

Profile icon
MaxwellGarner

@AIDANGREEN6 If you are talking about code notation, I don't know about the 6 spaces in front of each line, but just use three backticks and a newline:

\``` multiline code same multiline code \```

Just without the \s (I needed them or markdown would register it)

Profile icon
AIDANGREEN6

@MaxwellGarner That's useful to know for the future, but I actually wasn't trying to put it in a code notation section, it just appeared there. It was actually kind of annoying, because the bottom half was missaranged with the top half, so I had to edit it to cut off everything below his arm.

Profile icon
MaxwellGarner

@AIDANGREEN6 Oh yeah ok :) he's a great dino btw, going in the Spotlight section

Profile icon
AIDANGREEN6

@MaxwellGarner Thx. (however, looking in the spotlight section, I think he got disrupted through the copy and paste section- He looks kind of weird in the spotlight. (4 eyes, a u, a w,... How does he get THAT messed up?))

Profile icon
MaxwellGarner

@AIDANGREEN6 Lmao idk, try putting him all into a big code block (markdown compresses extra spaces, except in code blocks)

Profile icon
AIDANGREEN6

@MaxwellGarner Oh, that explains it! The stupid markdown...

Profile icon
RylanPetroelje

Didn't cure my cancer :-(

Profile icon
Whippingdot

was it supposed to... @RylanPetroelje

Profile icon
MaxwellGarner

@Whippingdot Yes of course, the mystery drug solves all taste it

Profile icon
Whippingdot

NO I WON'T even tho i have the symptoms of a healthy person @MaxwellGarner

Profile icon
MaxwellGarner

@Whippingdot Did you say you were... healthy ugh you sound like you need to taste the rainbow, this one right here, taste it taste it taste it t̵a̴s̴t̴e̴ ̶i̶t̴ t̶̹̑̐a̶̖̣͔̽͌́ś̸̰̜͊t̷̖̯̔̅͠e̵̮̩͌̾̚͜ ̴͔̹̽̀͠i̵͈̭͝t̵̙̫͎̑͑̋

Profile icon
Whippingdot

no i WON'T AAAAAAAAAAAAAAAAAAA @MaxwellGarner

Profile icon
MaxwellGarner

@Whippingdot it definitely gives you free high-speed wifi wherever you go

Profile icon
Whippingdot

i already have high-speed wifi @MaxwellGarner

Profile icon
MaxwellGarner

@Whippingdot
download

Profile icon
Whippingdot

image
I DON'T WANT TO RANDOM STRANGER ON THE ROAD!!!

Profile icon
MaxwellGarner

@Whippingdot You better taste that rainbow, or else ( ͡ʘ ͜ʖ ͡ʘ)

Profile icon
Whippingdot

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO @MaxwellGarner

Profile icon
MaxwellGarner

@Whippingdot According to @WILLIAMBAEWER it tastes like chicken, if that makes it easier

Either way TASTE IT
one of us, one of us, one of us...

Profile icon
Whippingdot

it might be a drug AAAA @MaxwellGarner

Profile icon
Whippingdot

i didn't try it HOOOOORAY

sneaks away quietly without you noticing @MaxwellGarner
Profile icon
MaxwellGarner

@Whippingdot oh no you DONT get back here and taste the rainbow

Profile icon
Whippingdot

no no no i won't listen to you. @MaxwellGarner

'how you look rn':
copied image

Profile icon
angrydoge

@Whippingdot
One of us, one of us, one of us...

Profile icon
Whippingdot

I do not understand the meme sry unless it is amog us @angrydoge

Profile icon
angrydoge

no not amogus @Whippingdot

Profile icon
Whippingdot

ok. Also u were inactive for a while right? @angrydoge

Profile icon
angrydoge

Yeah, I scrolled from time to time, but I haven't made any projects beside the one I made yesterday. @Whippingdot

Profile icon
angrydoge

Ơ̶̡̳̯̱̱̼̥̗̙͔̙͕̠͎̞̥̲̲͔͚̽́̀̓̎̐͗̔̆͝n̷̡̡̨̧̡̯͇̟͉̫̗͚̠̳̠̼͈̫͈͚̝̻̩̮͍̱̲͖̬̳̤̞̣̝̜̹̂͗̊͐̆̄̉́͆͗͑͊̾̂̾͐͋̍̑̈́̓̓͋̈́̀͆̂̕̚͜͝͝e̴̛̛͔̱̪̦̞̗͎̯̙̘̺̙͔̙͚̱͔̠̻̐͆̽͆͒̉͋̐̐̅̈́̚͜͜͠ ̷̲̭̳̺͚́̽̾̿͊̿̔̾͐̂̅̅͐̈́̍̈́̊̿̏̄̈́̒́̾̈͊̔͂͘͘ō̵̢͓̮̳̜͕͔̰̩͚̻͚͖͚͖̮̥͉͙̟̋̀̇̄̊̀f̶̨̻̪̩̻̰͖̼͗̊̿͑͛̍̉́̏̊͑͛̽̐͛͐͋̀̏̌̓͐̌͒̿͊̐͛̐̈̓͘͘̚̕͝ ̶̨̧̨͚̹̞̰͚͇̖̲̱̯͕͓̲̺̹̮̘̬̰̉͆̅̒̐̈́̇̂̕̕͜͜͜ư̶̧̨̛̼̰͙͚̹̳̬̻̖̞͆̏͋̾̓͊̏̉̄̀͊́́͆̉̾̄̄̂͆̈́́̚͝s̸̢̡͍̙̰͉̱͇͍̘̪̯̱̰͓̳͈͉͖͓̦̮̒̆̐̚,̶̢̧̛̖͎͇̻̹̖͖̲̓̏̎̈́̐̓͑͑͂̏̈͒̄͛́̇́̂̀͊͘͘̕̕͜͠͠ ̷̡̧̧̧̖͙̤̦̘̥͇̤̟̱͓̪̼͚̹̯͍͙̅̈̆̈̓̅̓͊̆͛̑͊̕̚̚͜͠ͅͅͅO̵̡̨̢̩̹̙̱̩͚͉̦̼̝̙͎̩͉͉͉̗̬̩̤̹͙̞̼̫̩͈̼̪̯̩͖̟̒̓̐̈́͂̈́̓̉͐́̈͘͜ͅņ̷̤̟͈̥̼͙͕̝͇̰̲̭͇̘͚͙̝͙̠͍̣͎̞̰̞̭̟̋̀͗͐́͂͆̎͌͌̈́̉͆̒̔́̂̀̎̓́͊̔̎̀̅̊̑̆̔̚͘͘̚͜ͅę̵̨͍͓͙̼̖̦̯͉̩͍̖̝̮̣̦̦̻̪͖͛́̉̏́̓̈̏͘͜͝ͅ ̶̨̡̡̡̯̘͔̜̗̦̹͇̼͍͍͖͎͕͙̗̳͚̻̺̮̰̈́̑͝ͅo̶͔̞̹̪̙̠̳̹̞̜̮̺̥͍͓̰͖̖͈͙̜͍̮͇͇͕͋̈̔̃͐͛̇̾͛́̽̀̾͜͜͜͜ͅf̵̧̢̡̨̖̪͚͕̺̭̠̯̱̩̲̻̺̣͚͚̗͍̼̗̻͗̑͐͆̐̚͘͠ ̵͚̘̠͇̗̐͆̅̄̀̆́̈̍͛̆́̌̽ǘ̶̞̼̦̩̻͚̱̋͆̍̆̈̍͆̇ş̴̨͔̼͙̘̥͇̣̟̣̯̪̭͙̆͝.̷̨̢̨̥͉̻̩̭͕̮̐͐͌͐̑̾̒͑̓͛̉̏͂̌͜͜͝͠͠.̷̧̢̧̪̱͈̟̩̯̹̥̣̣̠͔͚̤̣̺̺̰̉̿̆͂̈́̔͑̅̽͗̏̿͋̓̑̑͊̅̒͑̆̑̐͗̃͆͘̚͘͜͝.̵̡̬̘̱͕̥̫̘̹̾̓̾̇̌̌̽̕̕͝ @Whippingdot

Profile icon
mrslep

@MaxwellGarner

[._.] -()- /\
Profile icon
angrydoge
Profile icon
mrslep

@MaxwellGarner dont know how this got on the popular but super cool

Profile icon
YeeTEDWIN

Nice repl you got there. Very smooth for a python colour changing word! Nice job. Btw I just made a post of my game called survivor based off of a Commodore 64. Post Link: https://replit.com/talk/share/SURVIVOR/129509

Profile icon
Whippingdot

hey, don't advertise your post - you could get banned @YeeTEDWIN

Profile icon
YeeTEDWIN

Oh I didn't know sorry. Thanks for telling me
@Whippingdot

Profile icon
1andonlyaether

You want ACII art?
I'll give you ACII art. attempt #3

#####(###########(/(#################################((##########
.###.#/,///((####(///////////////(############%%.//(/#(/(##//(###
###((##(**//
(############((/%%%(/###%#####%%%/(*(#((//,####
%((#####//(###########%#.#% ,. (# ##%%#(%//(/(((/((&###(
##**(#((# ,, #####,. . , / @ .. .( /...#%%%&###
####/###( ((&## ,..%%. %. %%/ %&. ( .%#... ##%%####*
.###%#(&.. . ( &( % ,@. , %/ @. . .,%##%##%/
#####,#%/ &% . # # #. &@&%&%@@&&&%%(/#%%%&##%&&&&&#%%####%
.###(,((%&/.....%#%&%%#%########&%##/%///#%%%%##/((%%#############
##&(%%/#####%%#(/(/(///#&%%%(((///(#
/
//%%%%######%%%##########/
(##%(%#(######%%%&&&&%%%%%&%%%%%&&%&%%%%&%%%%%&&&&&%%%%%#########
.#########%###################################################%###

Profile icon
1andonlyaether

@1andonlyaether
I hate this place

Profile icon
MaxwellGarner

@1andonlyaether C'mon fourth time's the charm

Profile icon
SilvermoonCat

Traceback (most recent call last):
File "main.py", line 4, in
a=[0.5,1000000,False];' --- NOTICE: CONFIG --- | First element: rainbow length (0-256) | Second element: delay between steps (>0) | Third element: One line or many (bool)';import time;t="\033c" if a[2] else '';a[0]=0 if a[0]<1 else int(a[0]);a[0]=256 if a[0]>256 else a[0];a[1]=1 if a[1]<=0 else a[1];t+="\033[38;2;{};{};{}mTaste the rainbow.";j=range(0,256,256//a[0]);k=1/a[1];p=lambda a:print([t.format(a[0],a[1],a[2]),time.sleep(k)][0]);f1=lambda:print(['',[p((255-i,i,0)) for i in j]][0],sep='',end='',flush=True);f2=lambda:print(['',[p((0,255-i,i)) for i in j]][0],sep='',end='',flush=True);f3=lambda:print(['',[p((i,0,255-i)) for i in j]][0],sep='',end='',flush=True);run=lambda:print(['',[(f1(),f2(),f3()) for _ in range(100_000_000)], run()][0],sep='',end='',flush=True);run()
ZeroDivisionError: integer division or modulo by zero

Profile icon
MaxwellGarner

@SilvermoonCat No yeah sorry I was testing what happens if a float is put into the array. Fixed now

Profile icon
angrydoge
(⌐■_■) ( •_•)>⌐■-■ (•_•)
Profile icon
markverb1

T A S T E T H E R A I N B O W

Profile icon
Dedf1sh08

Rainbow sounds really delicious

Profile icon
Tacostorm2

But, how can I taste the rainbow if the rainbow, in it of it self, is a rainbow? Sorry... I speak weird after tasting that rainbow chicken pill thing. Oh yeah... I also grew 5 extra eyes.

Profile icon
ch1ck3n

I'm tasting it

Profile icon
CookieSnowOwl

lol i slowed it down and like every some moment there's a "easter egg lol"

Profile icon
MaxwellGarner

@MatthewHou You're the only one to have seen that lmao

Profile icon
CookieSnowOwl

can you do like a while True?

Profile icon
MaxwellGarner

@MatthewHou Unfortunately not -- Python does not allow multiple control statements per line. That is why every if is in an assignment (being used like ? : from C), every for is after an array (usage called 'list comprehension') and I use a for loop for run. for _ in itertools.count() functions the same as while True, though, I found out!

Profile icon
MarcusWeinberger

now do it without semicolons >;)

Profile icon
Whippingdot

nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo to hard @MarcusWeinberger

Profile icon
SleepySid

wow tHIS iSis som uch coo l

Profile icon
rafrafraf

this is amazing dude! if u wanna try to challenge urself more try do it with no semi colons

Profile icon
DAEMON816424

Nice :D

Profile icon
AIDANGREEN6

My homework, as mentioned in the code:


| 0 |___
| ___|
| |

Profile icon
BananaJellyfish

this is awesome!

Profile icon
1andonlyaether

You want ACII art?
I'll give you ACII art. attempt #2

...,/(((/*,. ...,,... ..,,,,...,,*/

,######(/(########%####/,(###################%######################(#############.
(###
##//**///(####(//////////////(((/####/########&%%/(((/(#((((%#///(%##,
%#####%%%(/
(,* /#################%/(/%(///(###(#######%%%//.(((/. /////(/#####,
.##(
/(%/,
/(###&#############/(%#((///(#,. /(# ####%%%((#%#%#(/(((%/(///####.
.##%(((#%%#%(//((((####(.#####%%%%%& ,/ ../ ##& #(((/ . (((########
##(,/#%((/. ,,. .###/.... . ( # %. .#. . # [email protected]#%%%%&####
###%#((#(% //##%%%* ,. .#%,. %. %#@ ,%&. #. &.... (%#%%######,
###%%%%#%
,# %%/. %( %%&. . /. .&. ,# , %( #%#######%
.####.,(##%%&&&&%. , , (& (@, &@#... ,. %%&. /&&@* ....%&/#%####/
%####,/(%@. .,.. &. ,#, ./%&@&%&@&&&%&&%####(//(/((##%###%#%%%%%######%#####
####%,
//%&@.,....(##%&&%%#%%##########&%%(((%////#%%%%%%#%/((#%%################.
(###%/(%#(##%%&&&&&#
/,//////((///#%&,,(#(////((,,,/(%&&&#((((&&(/((#(///(/(#####
###% ,/ ####%%##%%%%%%&####%%(((###(#%%%%%###
//##((#(##(/(#(%(#%(%(##/#####(
###%(&&%/######%%%##%#%%########%%%%%%%%%%%%%%%%%%%%%%%%######%%%%%%%%%###########/
.###########%%%#%%%%#######################################################%%%%%###

Profile icon
1andonlyaether

You want ACII art?
I'll give you ACII art.

...,/(((/*,. ...,,... ..,,,,...,,*/

,######(/(########%####/,(###################%######################(#############.
(###
##//**///(####(//////////////(((/####/########&%%/(((/(#((((%#///(%##,
%#####%%%(/
(,* /#################%/(/%(///(###(#######%%%//.(((/. /////(/#####,
.##(
/(%/,
/(###&#############/(%#((///(#,. /(# ####%%%((#%#%#(/(((%/(///####.
.##%(((#%%#%(//((((####(.#####%%%%%& ,/ ../ ##& #(((/ . (((########
##(,/#%((/. ,,. .###/.... . ( # %. .#. . # [email protected]#%%%%&####
###%#((#(% //##%%%* ,. .#%,. %. %#@ ,%&. #. &.... (%#%%######,
###%%%%#%
,# %%/. %( %%&. . /. .&. ,# , %( #%#######%
.####.,(##%%&&&&%. , , (& (@, &@#... ,. %%&. /&&@* ....%&/#%####/
%####,/(%@. .,.. &. ,#, ./%&@&%&@&&&%&&%####(//(/((##%###%#%%%%%######%#####
####%,
//%&@.,....(##%&&%%#%%##########&%%(((%////#%%%%%%#%/((#%%################.
(###%/(%#(##%%&&&&&#
/,//////((///#%&,,(#(////((,,,/(%&&&#((((&&(/((#(///(/(#####
###% ,/ ####%%##%%%%%%&####%%(((###(#%%%%%###
//##((#(##(/(#(%(#%(%(##/#####(
###%(&&%/######%%%##%#%%########%%%%%%%%%%%%%%%%%%%%%%%%######%%%%%%%%%###########/
.###########%%%#%%%%#######################################################%%%%%###

Profile icon
AIDANGREEN6

@1andonlyaether Don't sell the bike shop, orville.

Profile icon
1andonlyaether

test to see how much ascii thingies i can get in a single comment test to see how much ascii thingies i can get in a single comment test to see how much ascii thingies i can get in a single comment

Profile icon
ElijahReeves

omg amazing

Profile icon
TotallyNotSeth

[(f1(), f2(), f3()) for _ in itertools.count()] would loop forever... just make sure to import itertools!

Profile icon
MaxwellGarner

@SethPeace Thank you so much!

Profile icon
cannonthepom123

|VVVV|
| 0 0|
|____|
/|----|
( | | )
| /\ |
| | ||
W W
wow

Profile icon
MaxwellGarner

@cannonthepom123 Lol thanks! Another ASCII art professional, I see!

Profile icon
cannonthepom123
Profile icon
RhinoRunner

it went from changing colors smoothly to randomly flashing colors

Profile icon
MaxwellGarner

@RhinoRunner Oh lol sorry. My friend and I are messing around with the code, one of the variables controls that