Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help the idiot plox!

Name: poolboy 2006-11-16 20:41

Hey. I could use some help hear. i cant get my code to work. yes i know this is stupid as sin but its for a class. I have to place 3 names in order alphabeticly. how the names get in is unimportant, but what i need is the code to sort the names. you all would be tits ass kewl if you could tell me the right lines for this cuz i am tired of failling. lol.

Name: Anonymous 2006-11-16 21:05

I don't think programming is for you.

Name: Anonymous 2006-11-16 21:10

your right it's realy not. but for some reason i am in this class rather than javascripting. i think my school my be retarted. but i still want code. lol

Name: Anonymous 2006-11-16 23:15

What language?

Name: Anonymous 2006-11-17 0:08

java. sorry

Name: Anonymous 2006-11-17 0:41

We still don't think programming is for you. Seriously, even a bunch of nested if blocks could handle this.

Name: Anonymous 2006-11-17 1:16

Ask teacher for help

Name: Anonymous 2006-11-17 1:56

1 + 1 = one on a bun

Name: Anonymous 2006-11-17 2:01

for (i = 0; i == -1; i++) {
Console.WriteLine("PUT A STICK IN IT, STINK IN IT!");
}

Name: Anonymous 2006-11-17 4:59

retarted <

Name: Anonymous 2006-11-17 6:55

>>1
Trivial. I shouldn't tell you about it because it's your job to find out, but let's see if an example can get you on the right track for your programming course. Google for "direct insert sort" or "bubble sort", which are trivial sorting algorithms.

>>3
FYI, JavaScript is a programming language, and this sorting lists business is universal. You'll fail at programming anything if you can't do this. Please don't produce crappy JavaScript by copypasting "snippets" crap, and don't think you're "programming" by pressing Ctrl+V.

And FYI, JavaScript is a more advanced language than Java in many ways (built-in lists, built-in dictionaries, dynamic typing and binding, first class functions and methods, functions are closures, anonymous closures, easily extensible and more reflexive). It's just that its builtin library is inexistent, and it has mostly different uses.

Name: Anonymous 2006-11-18 2:59

print sort "Name 1", "Name 3", "Name 2"

Name: Anonymous 2006-11-18 6:08

print sorted(['Name 1', 'Name 2', 'Name 3'])

"Now with sane syntax"

Name: Liekzomg 2006-11-18 8:39

Okay you can do this
Turn everything lowercase
get the first letter of the word
get it's hex decimal value
store it in a variable
compare variables with decimal values.
an asciitable would help.
I can't be arsed to write the code atm ( i r lazy )

Name: Anonymous 2006-11-18 8:54

>>14
Way to make things complicated

Try the following:
1. Use Python.
2. Call the sort() method (in place) or the sorted() function (returns).
3. PROFIT.

Name: Anonymous 2006-11-18 11:14

>>14
No need to do it that hard. Java String object has a compareTo method.

From javadoc
the value 0 if the argument string is equal to this string; a value less than 0 if this string is lexicographically less than the string argument; and a value greater than 0 if this string is lexicographically greater than the string argument.
>>15
You're useless

Name: usux 2006-11-18 11:34

Well actually , that's the best way since the script cannot be confused by weird characters.
//out

Name: Anonymous 2006-11-18 11:38

>>16
Java sucks at sorting its crappy lists, and no matter how hard you try, you can't fix it.

Oh and compareTo, lol, equals and compareTo must be the gayest methods ever. Because a.equals(b) is so much clearer and fine than a == b; uglyCased methods deliver lower TCO thanks to its operational efficiency and enterprise-grade scalability.

Name: Anonymous 2006-11-18 12:13

>>18

It sorts just fine, although it (of course) takes abit more syntax than <insert your favorite scripting language>.

      List list = new ArrayList();
 
      list.add("abc");
      list.add("DEF");
      list.add("ghi");
 
      // standard sort
 
      Collections.sort(list);

I agree that equals and compareTo methods are ugly. I also don't like primitives in Java. It's still an OK language, though I prefer a (READ: my favorite) scripting language over it.

== is used to checking if two variables refrence the same object instance, hence it can't be used to compare the content of the object. I'd like it to though.

Name: Anonymous 2008-03-06 16:48


>>19
You are an idiot

Name: Anonymous 2009-01-14 14:38

FGGFDS

Name: Sgt.Kabu釩櫽kiman衡㝢 2012-05-28 20:58

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List