Submitted by [deleted] in total_noise (edited )
Comments
NOISEBOB wrote (edited )
emoticons wrote
spaces between words
I think simple to fix, just add result.append(' ')
?
for i, word in enumerate(words): # iterate through all words
for c in word: # iterate all characters in word
...
result.append(' ')
but then print(' '.join(result))
would space two times the word so can be good or bad depend on what is wanting :)
Very cool idea to do enumerate to keep increase after few words :)
[deleted] wrote
emoticons wrote
The basic computer science will do thing like variable scope, functions, loops, if, recursion, etc. Can even get basic algorithm -- sort and search -- like bubble sort insertion sort. linear search binary search. and simple data like linked list or binary tree.
More detail topic like program paradigm such object orient code with inheritance, polymorphism, abstract, etc and other paradigm such functional for immutability, no side effect, concurrency, etc
[deleted] wrote (edited )
emoticons wrote
YESSS!!! Awesome, i am happy you figured it~! :D
[deleted] wrote (edited )
emoticons wrote
customization
yes! that was my reason for make my post about this combining characters unicode! To explain how combining character does text and give example So that any one can extension it, customization and personalize it :D
[deleted] wrote
emoticons wrote (edited )
yayyy I am so happy for inspire you to share!! ~<3
This is get all combining character unicode from wikipedia :) funnyTextRange get all char from a
to b-1
and not c
. If c
is no argument, then no exclude anything
funnyTextRange=lambda a,b,c=-1:''.join(chr(i)for i in range(a,b)if i!=c)
funnyTextRange(768,880,847)+\
funnyTextRange(6832,6849)+\
funnyTextRange(7616,7680,7674)+\
funnyTextRange(8400,8433)+\
funnyTextRange(65056,65072)
or for exclude a array of chr instead just one
funnyTextRange=lambda a,b,c=():''.join(chr(i)for i in range(a,b)if i not in c)
funnyTextRange(65,70) == 'ABCDE'
funnyTextRange(65,70,(66,67)) == 'ADE'
edit: but yes that wikipedia does not have all that is a combining character :)
Edit 2: maybe another custom idea is to make a preset only do kaos for only some words
Ex: somefunny('The projectuals will blame the go-alongs, the right ideologues will blame the wrong ideologues', ('ideologues', 'blame'))
make only the word ideologues and blame do combining characters. and if empty, then random select words ;)
moonlune wrote
def main():
if __name__ == "__main__":
hahafunnytextgoesbrrrrr(s.argv[1], int(s.argv[2]))
main()
What's the use of doing this instead of simply calling the function at the end of the program like this:?
hahafunnytextgoesbrrrrr(s.argv[1], int(s.argv[2]))
emoticons wrote
For the import this python does not make any execute because __name__
is not __main__
for to import this python. it only make a two imports and two the function. but The run this python will do execute :)
NOISEBOB wrote (edited )
i still didn't try this... but i reposted it here