Share your repls and programming experiences

← Back to all posts
Hangman ONE LINER **WORKING** (1 line series)[no3]
h
rafrafraf (1395)

can you truly make hangman in python in one line?

In order to answer this question you need the following:

  • adderall

You do not want to know how difficult this was.
But yes it is achievable

character count: 1790

no semi-colons this is a true one liner

I dont even know where to start explaining all the problems that this challenge brought up but it helped me think of multiple new ways to solve one liner problems

P.S this took me roughly 8 hours to make, did it all today with one break

What should i should i make in 1 line next >:)

EDIT: it's been less than an hour since i coded this spineless invertebrate jelly of a code and i already have no idea how it works anymore :,)

Comments
hotnewtop
ch1ck3n (1622)

@ch1ck3n Now make a one liner using no lambdas

rafrafraf (1395)

@ch1ck3n that seems... impossible depending on what you want me to make in one line

ch1ck3n (1622)

@rafrafraf i challenge you to make a typing speed test thingimajigy (lambdas allowed and more then one line allowed for importing things)

rafrafraf (1395)

@ch1ck3n if you check the code then youll see how to import inline so it should be possible in one line although im not sure how to go about making a console based typing speed test.. not sure if thatd work well

OldWizard209 (1101)

Are you trying to be eco-friendly @rafrafraf ???

Pretty kewl

rafrafraf (1395)

@OldWizard209 ahahaha my goal is to make code so disgusting that not even i can understand it

OldWizard209 (1101)

XD But good job, I wouldnt even be able to do it in a hundred lines @rafrafraf

LuckyOreos (200)

Dude this rocks I’ve seen a lot of your other work to but this is epic

rafrafraf (1395)

@DarthVader29 thanks man! this is my proudest work ahaha

Silver13Soul (9)

Am I the only one who went into the code to find the answers?

FlaminHotValdez (441)

abuse ze lambda. again.

XanderK20 (7)

This code deeply disturbs me
And I love it, Could you add a couple more words though?

rafrafraf (1395)

@XanderK20 LMAO thanks man and will do!

JBloves27 (1719)

hahahaha, you should maybe add more words! Keep it up! lmao

adl212 (166)

technically you can just use exec

rafrafraf (1395)

@adl212 well yeah but wheres the challenge then? ive restricted myself to make it one expression (so cant start with "while [whatever]:") cant use semi colons, and of course no exec

adl212 (166)

@rafrafraf huh. I never knew you could even use semi colons in python lol. tho i like how you made your "while" function

rafrafraf (1395)

@adl212 lmaoo thanks man! I had to use recursion as theres no way to use while inline.. however someone recently showed me another way to go about it which ill try use for my next inline challenge

adl212 (166)

@rafrafraf don't worry i don't know how to do any of that stuff