MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/transprogrammer/comments/tbfq6e/neopronoun_generator/
r/transprogrammer • u/Dreamlogic2 • Mar 11 '22
32 comments sorted by
60
That is pretty funny, would be funnier if it was written in rust.
29 u/Dreamlogic2 Mar 11 '22 true, i (shockingly) dont know rust though 9 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 What? How did you become trans if you didn't learn Rust and/or install Arch (btw)?! 6 u/Dreamlogic2 Mar 11 '22 maybe i'm just faking it! 3 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 No, that can't be it. I'm the only tran who's faking it. Everyone else is valid. 2 u/Dreamlogic2 Mar 12 '22 ahh, maybe i just have amnesia 3 u/SpicyElectrons Mar 12 '22 was panicking before I got to the arch bit, cause I use arch btw 2 u/mattsowa Mar 11 '22 What's good??? Bruh
29
true, i (shockingly) dont know rust though
9 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 What? How did you become trans if you didn't learn Rust and/or install Arch (btw)?! 6 u/Dreamlogic2 Mar 11 '22 maybe i'm just faking it! 3 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 No, that can't be it. I'm the only tran who's faking it. Everyone else is valid. 2 u/Dreamlogic2 Mar 12 '22 ahh, maybe i just have amnesia 3 u/SpicyElectrons Mar 12 '22 was panicking before I got to the arch bit, cause I use arch btw 2 u/mattsowa Mar 11 '22 What's good??? Bruh
9
What? How did you become trans if you didn't learn Rust and/or install Arch (btw)?!
6 u/Dreamlogic2 Mar 11 '22 maybe i'm just faking it! 3 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 No, that can't be it. I'm the only tran who's faking it. Everyone else is valid. 2 u/Dreamlogic2 Mar 12 '22 ahh, maybe i just have amnesia 3 u/SpicyElectrons Mar 12 '22 was panicking before I got to the arch bit, cause I use arch btw
6
maybe i'm just faking it!
3 u/GCU_Heresiarch Rewriting my gender in Rust Mar 11 '22 No, that can't be it. I'm the only tran who's faking it. Everyone else is valid. 2 u/Dreamlogic2 Mar 12 '22 ahh, maybe i just have amnesia
3
No, that can't be it. I'm the only tran who's faking it. Everyone else is valid.
2 u/Dreamlogic2 Mar 12 '22 ahh, maybe i just have amnesia
2
ahh, maybe i just have amnesia
was panicking before I got to the arch bit, cause I use arch btw
What's good??? Bruh
35
Here it is as a Haskell list comprehension:
let chars = ['a'..'z'] in [a : b : c : [] | a <- chars, b <- chars, c <- chars]
12 u/Dreamlogic2 Mar 11 '22 edited Mar 11 '22 ah, i was wondering if it was possible to do it through list comprehension but I'm kinda braindead today so took an easier approachedit: i still kinda prefer mine as it allows for changes in how many characters to allow 15 u/v16anaheim Mar 11 '22 edited Mar 11 '22 My python is a little rusty but I think you could do:from string import ascii_lowercase as chars [a + b + c for a in chars for b in chars for c in chars]Not sure how to extend it to arbitrary lengths tho. 6 u/szemeredis_theorem Mar 11 '22 pronouns n = let chars = ['a' .. 'z'] in iterate (\ps -> [ a : p | a <- chars, p <- ps ]) [[]] !! n 2 u/v16anaheim Mar 11 '22 it's beautiful 😍
12
ah, i was wondering if it was possible to do it through list comprehension but I'm kinda braindead today so took an easier approach
edit: i still kinda prefer mine as it allows for changes in how many characters to allow
15 u/v16anaheim Mar 11 '22 edited Mar 11 '22 My python is a little rusty but I think you could do:from string import ascii_lowercase as chars [a + b + c for a in chars for b in chars for c in chars]Not sure how to extend it to arbitrary lengths tho. 6 u/szemeredis_theorem Mar 11 '22 pronouns n = let chars = ['a' .. 'z'] in iterate (\ps -> [ a : p | a <- chars, p <- ps ]) [[]] !! n 2 u/v16anaheim Mar 11 '22 it's beautiful 😍
15
My python is a little rusty but I think you could do:
from string import ascii_lowercase as chars [a + b + c for a in chars for b in chars for c in chars]
Not sure how to extend it to arbitrary lengths tho.
pronouns n = let chars = ['a' .. 'z'] in iterate (\ps -> [ a : p | a <- chars, p <- ps ]) [[]] !! n
2 u/v16anaheim Mar 11 '22 it's beautiful 😍
it's beautiful 😍
20
itertools is your friend :D
itertools
from itertools import combinations_with_replacement as cwr for p in cwr('abcdefghijklmnopqrstuvwxyz', 3): print(''.join(p))
1 u/Dreamlogic2 Mar 11 '22 oh, thats useful, ty!
1
oh, thats useful, ty!
My new pronouns are zzz/zzp
3 u/Dreamlogic2 Mar 11 '22 hot 1 u/chicken_is_no_weapon Allows text and up to 10 emojis Mar 20 '22 don't tell anyone on the daily wire
hot
don't tell anyone on the daily wire
8
oh my god what the FUCK i had the idea for this EXACT SAME THING TODAY like maybe an hour before you even made this post?? holy shit lmao
4 u/Dreamlogic2 Mar 11 '22 lmao i was just bored and was going to make a list of short terms i liked in terms of a name and compile them into a list and then make something to put those in a random order too, but figured i could make a joke off of this lmao
4
lmao i was just bored and was going to make a list of short terms i liked in terms of a name and compile them into a list and then make something to put those in a random order too, but figured i could make a joke off of this lmao
stupid code i wrote in a few minutes but if you want to use it for some reason and not write it out here it is:
alphabet = list('abcdefghijklmnopqrstuvwxyz')strl = 3def write(add):for i in alphabet:if strl - (len(add) + 1) > 0:write(add + i)elif not strl - (len(add) + 1) > 0:print(add + i)returnfor i in alphabet:write(i)
alphabet = list('abcdefghijklmnopqrstuvwxyz')
strl = 3
def write(add):
for i in alphabet:
if strl - (len(add) + 1) > 0:
write(add + i)
elif not strl - (len(add) + 1) > 0:
print(add + i)
return
write(i)
ProTip: you can iterate over the alphabet by doing for i in "abcdefghijklmnopqrstuvwxyz"; no need to turn it into a list.
for i in "abcdefghijklmnopqrstuvwxyz"
1 u/Dreamlogic2 Mar 12 '22 cool ty!
cool ty!
How long does it take to fully exhaust pronoun-space?
4 u/Dreamlogic2 Mar 11 '22 a little under 1 second for 3 characters
a little under 1 second for 3 characters
16
zzz: sleepygender
Try functional style:
alpha = list(map(chr, range(97, 123)) neopronouns = [a+b+c for a in alpha for b in alpha for c in alpha] for np in neopronouns: print(np)
Or in Ruby:
puts ('aaa'..'zzz').to_a
2 u/8Bit-Giraffe Mar 12 '22 and THIS is why i love ruby
and THIS is why i love ruby
Should've opened the file in NeoVim lol
60
u/Standard_Humor5785 Lily🌸🌺_she/her_embedded Mar 11 '22
That is pretty funny, would be funnier if it was written in rust.
35
u/v16anaheim Mar 11 '22 edited Mar 11 '22
Here it is as a Haskell list comprehension:
let chars = ['a'..'z'] in [a : b : c : [] | a <- chars, b <- chars, c <- chars]20
u/lowpass Mar 11 '22
itertoolsis your friend :D15
u/Yeslovc Mar 11 '22
My new pronouns are zzz/zzp
8
u/gamersex Mar 11 '22
oh my god what the FUCK i had the idea for this EXACT SAME THING TODAY like maybe an hour before you even made this post?? holy shit lmao
6
u/Dreamlogic2 Mar 11 '22
stupid code i wrote in a few minutes but if you want to use it for some reason and not write it out here it is:
alphabet = list('abcdefghijklmnopqrstuvwxyz')strl = 3def write(add):for i in alphabet:if strl - (len(add) + 1) > 0:write(add + i)elif not strl - (len(add) + 1) > 0:print(add + i)returnfor i in alphabet:write(i)4
u/SIGSTACKFAULT unironically wears thigh-highs. they're warm! Mar 11 '22
ProTip: you can iterate over the alphabet by doing
for i in "abcdefghijklmnopqrstuvwxyz"; no need to turn it into a list.2
u/OrbitalHippies Mar 11 '22
How long does it take to fully exhaust pronoun-space?
16
u/emipyon Mar 11 '22
zzz: sleepygender
3
u/everything-narrative Mar 11 '22
Try functional style:
Or in Ruby:
1
u/[deleted] Mar 11 '22
Should've opened the file in NeoVim lol