[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Someone please pseudocode the name generation algorithm. I'm
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 59
Thread images: 8
File: image.jpg (238 KB, 1155x1042) Image search: [Google]
image.jpg
238 KB, 1155x1042
Someone please pseudocode the name generation algorithm. I'm curious.
>>
Do your own homework fuccboi
>>
are you serious?
when(post):
name=firstname[rand(firstname.length)] + " " + lastname[rand(lastname.length)]
subject= input.subject
post=input.post

it doesn't exactly have to be complicated
>>
>>53814628
what the fuck is this shit
>>
public static void main(String args[]) {
// Generates a list of names to be used.
GenerateNames();
}
>>
>>53814653
five minute pseudocode, nigger. you want quality, make go to someone who cares.
>>
>>53814671
that is neither a pseudocode nor was it made in five minutes
a fucking monkey could type out a more sensible pseudocode in 5 mins than that
did you start """""programming""""" like a month ago or something?
>>
>>53814727
what is bad about it
>>
>>53814534
Concat 2 random names from 2 separate lists of names, return the result.

This hardly requires psuedocode
>>
>>53814761
you mean besides quite literally every single line?
>>
sudo pip install names

>>> import names
>>> names.get_full_name()
>>
>>53814806
just say what's wrong with it instead of saying "it's wrong because it's wrong"
>>
If my name is Robert I know the solution
>>
>>53814765
thus
>>
>>53814814
that wasn't pseudo code,
its literal code.
get your head out of your ass, do you also not know what the fuck a flow chart is?
>>
>>53814830
Shutup mom
>>
>>53814765
it's possible it doesn't allow immediate duplicates
other than that, this

>>53814628
this is right
>>
>>53814814
>when(post)
wtf does this have to do with name generation algorithm
>name=...
might as well just say
name <- randelt(firstname) . " " . randelt(lastname)

>subject=...
wtf does this have to do with name generation algorithm
>post=...
wtf does this have to do with name generation algorithm
>>
>>53814848
you're going nowhere in life

remember me when you've realized this
>>
>>53814877
kill yourself, >>53814765 was much better solution than yours
he also didnt make himself look like a fucking idiot
>>
>>53814848
What are you on, that's psuedocode. I didn't even write that, the only language really I know is scheme, and the procedure that's describing is perfectly parseable. Stop making a fuss out of nothing.
>>
>>53814900
Sure kid,
i feel sad for you due to how far in that head is stuck.
Enjoy stroking that fat fucking ego of yours, you are surely correct in this situation, and not wrong in many ways at all.
>>
>>53814952
>that's psuedocode
lol
>the only language really I know is scheme
sure you do
>>
a = list of names
b= list of last names

name = random.pick(a) + " " + random.pick(b)
print(name)
>>
>>53814534
Sauce?
>>
>>53814534
Sauce?
>>
File: image.png (1 MB, 1155x1042) Image search: [Google]
image.png
1 MB, 1155x1042
>>53814534
>>
>>53814534
connect to facebook api
pick random profile
return name
put into script for name
>>
>>53815079
>>53815085
I think she's Saten from To aru kagaku no Railgun.
>>
>>53814848
arent you that guy from rage against the machine
>>
>>53815381
that's morello
>>
>>53814877
i does allow dupes
>>
var firstname = ["name1", "name2"...];
rand select firstname;
var lastname = ["name1", "name2"...];
rand select lastname;
name = concat;

cheers, pradeep
>>
File: 1457963812344.jpg (93 KB, 806x813) Image search: [Google]
1457963812344.jpg
93 KB, 806x813
>>53814905
nigga...

>Concat 2 random names from 2 separate lists of names, return the result.

> name=firstname[rand(firstname.length)] + " " + lastname[rand(lastname.length)]
>>
File: 1455604241439.gif (3 MB, 300x168) Image search: [Google]
1455604241439.gif
3 MB, 300x168
>>53814666
Ohhh Tiffany....
>>
>>53814653
It reads objects with first and last names, picks a random one, and sets it as the post author. You should enroll in a women's empowerment/coding class, Dianne.
>>
File: 56787654567.gif (889 KB, 500x286) Image search: [Google]
56787654567.gif
889 KB, 500x286
>>53814894

>>when(post)
>wtf does this have to do with name generation algorithm

You dumbfuck, do you think a name is generated all the time even when is not required?

>>name=...
>might as well just say name <- randelt(firstname) . " " . randelt(lastname)

what the fuck is randeltjfhjakskfb ??? And what does it do? That makes it even a worse """ pseudocode"""

>>subject=...
>wtf does this have to do with name generation algorithm
>>post=...
>wtf does this have to do with name generation algorithm

see above you dumbass
>>
>>53815688
you are retarded marsha
>>
>>53815273
I don't remember this scene...
>>
>>53815716
sure Krista, whatever you say hun. Here have a tampon and suck it up bitch
>>
>>53815688

So write some better fucking code, Marsha. God damn.
>>
>>53814894
Stephen Mayo? How ya doin buddy?! We haven't seen each other since high school! So you got into coding, that's great, I'm a lonely investment banker now. Nice talkin to ya, keep hackin away dude!
>>
>>53815688
>You dumbfuck, do you think a name is generated all the time even when is not required?
Do you even understand how computers work?
>>
>>53815716
>>53815811
have either of you chumps ever been to marsha.codes? no I don't fucking think so
>>
File: kim_jon.gif (1 MB, 242x322) Image search: [Google]
kim_jon.gif
1 MB, 242x322
>>53815811
goddammit Emma, did you also get triggered?
U mad because Shame is smarter than you?
Is patriarchy oppressing you again?
>>
if (post.submitted) 
post.set_name(random_choice(firstnames) + " " + random_choice(lastnames))
>>
File: 1362272369752.gif (417 KB, 176x119) Image search: [Google]
1362272369752.gif
417 KB, 176x119
>>53815854
sorry brony, the underlying architecture of a computer is irrelevant in this case.
>>
>>53815865
>
if (post.submitted)

What the fuck else is it going to be, conjured up from thin air?
>>
>>53815624
Damn Priscilla that's savage.
>>
File: shots_fired.gif (1 MB, 322x242) Image search: [Google]
shots_fired.gif
1 MB, 322x242
>>53815624
>>
This name generation algorithm sucks. The male/female distribution is completely unrealistic.

It should be like 99.9% male on /g/.
>>
>>53814534
So... basically
char *random_name(list_t *names, list_t *surnames)
{
unsigned name_sel = rand() % names->total;
unsigned surname_sel = rand() % surnames->total;
unsigned str_size = strlen(names->arr[name_sel]) +
strlen(surnames->arr[surname_sel]) + 2;
char *str = (char *) malloc(sizeof(char) * str_size);
sprintf(str, "%s %s", names->arr[name_pick],
surnames->arr[surname_pick]);
return str;
}
>>
>>53816359
thats not pseudocode
>>
>>53816476
real code is easier to visualize
>>
it's probably a database though
string getname()
{
sql = open(database.db);
string firstname = sql.get("SELECT RAND(SELECT COUNT(first) FROM Names;) FROM Names;);
string lastname = sql.get("SELECT RAND(SELECT COUNT(last) FROM Names;) FROM Names;);
//or however the fuck you query a database in whatever languge
return firstname + " " + lastname;
}
>>
>>53816507
fuck quotes
>>
Never
>>
>>53815000
>>53814806
>>53814848
>if it's not done exactly the way it is in my textbook, it's not pseudocode!
You sure convinced me with those hot opinions
>>
import java.lang.string
import java.util.random

public class NameGenerator {

private String[] firstNames = {"put", "your", "names", "here"};
private String[] lastNames = {"put", "your", "names", "here"};
private String fullName;
private int rand1;
private int rand2;

public String makeName {
Random random = new Random()
rand1 = random.nextInt(3) + 1
rand2 = random.nextInt(3) + 1
return firstNames[rand1] + " " + lastNames[rand2]
}
}
Thread replies: 59
Thread images: 8

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.