Author |
Message |
SpaceDude
|
Posted: Tue Jun 08, 2004 8:23 pm Post subject: Shortening this code? or easier to write it? |
|
|
anyone know how i can shorten this code up? or write it easier?
code: | var Names : array 1..100 of string
Names (1) := "Bob"
Names (2) := "Albert"
Names (3) := "Patrick"
.
.
.
.
.
Names (98) := "Sam"
Names (99) := "Thomas"
Names (100) := "Raymond" |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
aside
|
Posted: Tue Jun 08, 2004 8:46 pm Post subject: (No subject) |
|
|
you can store the names in a file and call it, then use get with your variables. |
|
|
|
|
|
SpaceDude
|
Posted: Tue Jun 08, 2004 8:49 pm Post subject: (No subject) |
|
|
what if it has to be all done in one turing file, like no side files and etc? |
|
|
|
|
|
aside
|
Posted: Tue Jun 08, 2004 8:51 pm Post subject: (No subject) |
|
|
well, you can simplify it a little by this:
code: |
var names: array 1..100 of int :=init("bob", "mjkjk", ...."kdj")
|
and why does it have to be done in one file? |
|
|
|
|
|
SpaceDude
|
Posted: Tue Jun 08, 2004 8:53 pm Post subject: (No subject) |
|
|
cuz is a project lol, i have to submit it, so basically it has to be all done in this turing file and no sidefiles |
|
|
|
|
|
aside
|
Posted: Tue Jun 08, 2004 8:56 pm Post subject: (No subject) |
|
|
well, that's just stupid. and why do you need all these names?
anyway, ignore me. |
|
|
|
|
|
SpaceDude
|
Posted: Tue Jun 08, 2004 8:57 pm Post subject: (No subject) |
|
|
o the file is similar to this is not the same though lol
so basically there is no other way to shorten this code up? |
|
|
|
|
|
aside
|
Posted: Tue Jun 08, 2004 9:01 pm Post subject: (No subject) |
|
|
well, you have to include all the names somehow, think about it, it is already simple enough. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
SpaceDude
|
Posted: Tue Jun 08, 2004 9:11 pm Post subject: (No subject) |
|
|
i guess lol thanks
if any 1 else have any ideas or suggestions just post it here i wanna see if there is other ways, cuz it is very very long lol |
|
|
|
|
|
Tony
|
|
|
|
|
SpaceDude
|
Posted: Wed Jun 09, 2004 12:02 am Post subject: (No subject) |
|
|
lol tahts pretty amazing lol
but their not really names lol |
|
|
|
|
|
Tony
|
Posted: Wed Jun 09, 2004 2:34 pm Post subject: (No subject) |
|
|
i'm sorry, but that's as close as you can get to real names without the use of any kind of external dictionary... Some names generated are preaty good actually |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
SpaceDude
|
Posted: Wed Jun 09, 2004 3:09 pm Post subject: (No subject) |
|
|
lol ic
i guess so lol |
|
|
|
|
|
Paul
|
Posted: Thu Jun 10, 2004 6:27 pm Post subject: (No subject) |
|
|
Just get one of those name lists, put it into a text file, then load them up into an array using a loop, and randomly choose some names. |
|
|
|
|
|
naoki
|
Posted: Fri Jun 25, 2004 4:25 pm Post subject: (No subject) |
|
|
apprently, either spacedude sucks or whoever's teaching him sucks
why in god's name would a teacher demand 100 names from a student, without the use of textfiles, and won't accept anything with improv like random name generation?
now, you could do something like whenever you take a name, and put it into an array, take the next array space, and using the same name, catenate "ina" to the end, to make it seem like a girls
code: |
for x : 1 .. 100 by 2
put "input a name"
get name : *
namelist (x) := name
namelist (x+1) := name + "ina"
end for
|
|
|
|
|
|
|
|