Chinese Children's Cartoons Imageboard

Hey Sup Forums
you know that meme where we call Sup Forums a "chinese cartoons imageboard" or "norwegian goat herding forum" or whatever

i made a program that randomly generates names

it generates lists from the three txt files (they have to be in the directory with the executable, you can change them, line limit of 50 characters), then just throws them together.

> github.com/JaxonSkye/chan.git
Three .txt modifiable dictionaries, the source code, and an already compiled executable.
What do you think?

Other urls found in this thread:

github.com/JaxonSkye/chan.git
sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/
twitter.com/SFWRedditGifs

this was completely necessary and i applaud you for your effort

I wrote this same thing like two years ago

I'm glad someone else on a Libyan Mountain-biking forum had this idea

>Cambodian Neurosurgery Fraternity
Good work, user.

>Coptic AMD Onion Node
cyberpunk af

>not making it deep learn the meme for infinite lulz
at least it was a fun 5 min programming exercise that you could post on a mongolian basketweaving bbs

>>not making it deep learn the meme for infinite lulz

are you legitimately 15 years old

>French Canadian roleplaying microbrewery
lol

so he could crawl a guatemalan beekeeping forum for instances of the meme, record what actual anons post, and use that to weight the probabilities of the words it chooses?

is called an croat hand waxing tabloid you mongoloids

more than double that lol xDDD

sure, hoping it would learn that the formula was akin to [ethnicity|group] [activity|industry|thing] [social messaging medium] or however complex it is

actually this is the Sudanese stormchasing subsection

woah the things you learn on an alaskan moosemeat blackmarket documentary

I thought this was a Mongolian Croat-waxing tabloid.

Good work OP. Also nice korbo

>using C
it's a one-liner in python

well that's just no fun

how... how did you learn to program such complicated algorithms?! are you some kind of genius???

>What do you think?

>unused includes
>global variables
>global variables passed as arguments with the same name
>constants are neither const nor #defines
>all caps identifiers that are not #defines
>inconsistent placement of asterisks in pointer definitions
I think you have lots of work to do.

not op here, rate my python version

import random

f0 = "adjectives.txt"
f1 = "actions.txt"
f2 = "areas.txt"

listOne = []
listTwo = []
listThree = []

filename = [f0,f1,f2]
list = [listOne, listTwo, listThree]
listNum = [0]*3

for i in range(0,3):
with open(filename[i]) as infile:
list[i] = infile.readlines()
list[i] = [x.strip() for x in list[i]]

numGen = input("Generate how many names? ")
print "Generating ", numGen, "names."

for j in range(0,numGen):
for i in range(0,3):
listNum[i] = random.randrange(0,len(list[i]))
assert (0

why do you have three other repositories that are basically empty?

public class thing{
public static void main(String[] args){
System.out.println ("This is a string.");
}
}

>on Sup Forums
>over 30

>you don't need listOne-Three use [[]] * 3 instead
>if you want extra variables for each filename is debatable
>why is there an assert?
>you don't need a list for listNum if you just use it in the same block

Good, now make a shit post generator.

damn that helps a lot, thanks
the extra variables for the filenames was in to make it clearer in case you changed filenames manually, but I guess its still clear without that anyway
the assert was because I havent used the random range generator before and I didnt trust it

how does this look now?

import random

filename = ["adjectives.txt","actions.txt","areas.txt"]
list = [[]]*3

for i in range(0,3):
with open(filename[i]) as infile:
list[i] = infile.readlines()
list[i] = [x.strip() for x in list[i]]

numGen = input("Generate how many names? ")
print "Generating", numGen, "names."

for j in range(0,numGen):
for i in range(0,3):
listNum = random.randrange(0,len(list[i]))
print list[i][listNum],
print


does anyone know why printing
numGen = input()
print 'text', numGen, 'text'

includes spaces around the input number automatically?
is it just a feature? I would have imagined it wouldnt do that

Looks pretty gud! You can take a look at random.choice() which would make the code a bit tidier and then maybe reduce the inner loop with a list comprehension

got it down to this:

import random

filename = ["adjectives.txt","actions.txt","areas.txt"]
list = [[]]*3

for i in range(0,3):
with open(filename[i]) as infile:
list[i] = infile.readlines()
list[i] = [x.strip() for x in list[i]]

numGen = input("Generate how many names? ")
print "Generating", numGen, "names."

for j in range(0,numGen):
for i in range(0,3):
print random.choice(list[i]),
print


I'm not understanding how list comprehension can reduce it further though

is this the type of thing you meant by list comprehension?
p = [random.choice(list[i]) for i in range(0,3)]
print p,

not the one you answer to but probably meant replacing

for i in range(0,3):
print random.choice(list[i]),
print


with

print ' '.join(random.choice(list[i]) for i in range(0,3))


some other notes as it seems you're coming from another lang

you can do range(x) instead of range(0,x)
you can use a for loop over a list of items
you don't have to initiate the list, you can append
don't use list as variable name (it is also the name of a built-in function)
use dict instead of list for immutable such as the filename list

thanks friend, I'll look into working those in too
I do electrical engineering and the most we ever realistically use is a small amount of matlab but I've been trying to expand a bit by myself as a side hobby

>github.com/JaxonSkye/chan.git

>rand()

sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/

Seriously though this is something I've always struggled with.

LINE_LEN is hard coded. And that's fine if the OP write all the .txt files and knows the smallest safe value. But what happens when someone adds a 60 character adjective?

All these memes about "safe" C involve reading the right amount of characters but there's no sane way to make this code work when it's not assigned to one variable.

How would you make this extensible?

can you give me a small idiots rundown on why urandom might be better than rand()?

is it just safer?

because this is such a security-critical application, right? We wouldn't want random numbers that might be statistically random but not cryptographically secure on our Argentinian origami forum.

You're supposed to use alliteration and something that vaguely describes visual art, you flaming faggots.

Chinese cartoons
Taiwanese tapestry
Cantonese cave paintings
Etc

But you can do this in google spreadsheet.

>complaining about improper usage of memes on a Kuwaiti Badminton website

>dict
meant tuple

Your shtty code doesn't compile properly, just prints out the contents of one of the files

>overwriting builtins
you deserve to die tbqh

import random
import pyperclip

filenames = ['actions.txt', 'adjectives.txt', 'areas.txt']

output = []
for f in filenames:
with open(f, 'r') as input_file:
w = random.choice([x.strip() for x in input_file.readlines()])
output.append(w)

output = ' '.join(output)
pyperclip.copy(output)

print output

copies the string to clipboard for maximum shitposting efficiency

>Serbian AMD repository

sorry friendo

Make a site, faggot. It's not that hard.

>paying money so that a total of 6 people can shitpost more

>Japanese Thinkpad Forum
/tpg/... I...

Basque Tie Knitting Community
French Canadian NEET Culture Sorority
Filippine Contrabass Enthusiasts Board
Chinese Dog Breeding Deep Web Drug Marketplace
Basque Astrology Subreddit

Please don't play with our naturally occurring memes and shitposting. This is Reddit shit.

Gonna make a website out of this and put lots of ads on it thanks OP

I've heard Ukrainian Bear-skinning Forum before

Finally, someone with gumption.

...

I wanted something that could run without depending on anything else being installed
Yeah kinda just threw things together until it worked
If you decide the hidden message in the names of the repos, moot appears and turns you into a little girl
I think tumblr can make a free site with this/basically this on it, but I don't really want to mess with tumblr that much

>not already having a server and domain
sure is summer in here

>2017
>posting babbys first code on a coptic amd onion node