 |
|
 |
Now this is java |
 |
|
Author |
Message |
PO Info |
 |
Aindriahhn Auralyth: Chosen of Wind

Gender:  Joined: 25 Sep 2002 |
Posted: Mon Apr 05, 2004 1:56 pm Post subject: Now this is java |
// The "LoopColours" class.
import java.applet.*;
import java.awt.*;
import hsa.Console;
public class LoopColoursPlus extends Applet
{
int x1, y1;
int i = 1;
int a = 1;
double x, y, ranNum;
double rightBorder = size ().width;
public void mouseDown (Event evt)
{
i = i + 1;
repaint ();
}
public void paint (Graphics g)
{
//paints a row of red squares
do
{
do
{
g.setColor (Color.red);
g.drawString ("Hello", (int) (Math.random () * size ().width) + 1, (int) (Math.random () * size ().height) + 1);
a++;
}
while (a != 90000);
i=i+1;
}
while (i == 1);
do
{
i = i + 1;
}
while (i == 2);
do
{
for (a = 1 ; a < 100000000 ; a++)
// x+=20 is the same as x = x + 2
{
x =(Math.random () * size ().width) + 1;
y = (int) (Math.random () * size ().height) + 1;
x1 = (int) x;
y1 = (int) y;
if (x > y & x > (y + 100))
{
g.setColor (Color.yellow);
g.drawRect (x1, y1, 18, 1 ;
}
else if (x < y & x < (y - 100))
{
g.setColor (Color.red);
g.drawRect (x1, y1, 18, 1 ;
/* x is the x-axis co-ordinate
20 is the y-axis co-ordinate
18 is the width of the rectangle
18 is the height of the rectangle*/
}
else if (x > (y - 100) & x < (y + 100))
{
a = a + 1;
g.setColor (Color.blue);
g.drawRect (x1, y1, 18, 1 ;
}
g.setColor (Color.black);
g.fillRect (x1, y1 + 1, 19, 17);
}
}
while (i == 0);
} // paint method
} // LoopColours class |
_________________
I've abandoned religion in favour of PARTY TIME. |
|
|
 |
 |
Wins 11 - Losses 12 Level 5 |
EXP: 4314 HP: 2100
 |
STR: 700 END: 700 ACC: 1000 AGI: 500
|
Rune Carved Claymour (Sword) (200 - 420) |
|
|
Back to top |
|
 |
Shino Fade into this fantasy, caught in the web of time

Age: 49 Gender:  Joined: 15 Sep 2002 |
Posted: Mon Apr 05, 2004 3:15 pm Post subject: |
|
|
 |
 |
Wins 190 - Losses 169 Level 21 |
EXP: 11590 HP: 3150
 |
STR: 1050 END: 1050 ACC: 1200 AGI: 1200
|
Bianco & Nero (Sabers) (500 - 600) |
|
|
Back to top |
|
 |
Aindriahhn Auralyth: Chosen of Wind

Gender:  Joined: 25 Sep 2002 |
Posted: Mon Apr 05, 2004 4:28 pm Post subject: |
I know, I know, I should have used case switches...
But it looks pretty... |
_________________
I've abandoned religion in favour of PARTY TIME. |
|
|
 |
 |
Wins 11 - Losses 12 Level 5 |
EXP: 4314 HP: 2100
 |
STR: 700 END: 700 ACC: 1000 AGI: 500
|
Rune Carved Claymour (Sword) (200 - 420) |
|
|
Back to top |
|
 |
reaper I miss you Shar

Gender:  Joined: 28 Dec 2002 |
Posted: Mon Apr 05, 2004 4:34 pm Post subject: |
Hmmmm i should look into learnin java, looks realy similar to C++ which i am familiar with already |
_________________ All religion is a defense against a religious experience - Carl Jung
The power of philosophy floats through my head, light like a feather, heavy as lead - Bob Marley
The pioneers of a warless world are the youth that refuse military service - Albert Einstein |
|
|
 |
 |
Wins 151 - Losses 189 Level 22 |
EXP: 7585 HP: 2600
 |
STR: 1000 END: 800 ACC: 1550 AGI: 1250
|
(Blades) (450 - 680) |
|
|
Back to top |
|
 |
Therin Gloompf. Iggle!

Gender:  Joined: 24 Sep 2002 |
Posted: Mon Apr 05, 2004 4:35 pm Post subject: |
|
|
 |
 |
Wins 45 - Losses 36 Level 10 |
EXP: 6251 HP: 2600
 |
STR: 950 END: 825 ACC: 825 AGI: 800
|
Gray Matter (Gun) (240 - 530) |
|
|
Back to top |
|
 |
Musashi Scrummy Translator

Gender:  Joined: 07 Nov 2002 |
Posted: Mon Apr 05, 2004 5:59 pm Post subject: |
Java's only similar to C++ because its syntax looks similar. Underneath everything is very very different. Though Java's actually a good deal simpler than C++. If you already know C++ it would be pretty easy to pick up. Oh, and Ada is t3h sux0rs, but its used by the government, what do you expect? |
_________________
 |
|
|
 |
 |
Wins 102 - Losses 87 Level 14 |
EXP: 8440 HP: 2800
 |
STR: 1000 END: 900 ACC: 875 AGI: 1025
|
Arcanum (Sword) (395 - 495) |
|
|
Back to top |
|
 |
Terin Huzzah!

Gender:  Joined: 27 Oct 2003 |
Posted: Thu Apr 08, 2004 10:27 am Post subject: |
I'm still confused. Where's the coffee?
-T |
|
|
|
 |
 |
Wins 41 - Losses 57 Level 10 |
EXP: 4282 HP: 2330
 |
STR: 850 END: 740 ACC: 1000 AGI: 710
|
Magnificent Mace of 1000 Misses (Mace) (370 - 400) |
|
|
Back to top |
|
 |
Aindriahhn Auralyth: Chosen of Wind

Gender:  Joined: 25 Sep 2002 |
Posted: Tue Apr 13, 2004 10:22 pm Post subject: |
Ahh, version 2, well 7 really
Code: |
// The "LoopColours" class.
import java.applet.*;
import java.awt.*;
import hsa.Console;
public class LoopColoursPlus extends Applet
{
Color color, color1, color2, color3, color4, color5;
int x1, y1, c, word;
int i = -1;
int a = 1;
double x, y, ranNum;
double rightBorder = size ().width;
public void mouseDown (Event evt)
{
i = i + 1;
repaint ();
}
public void paint (Graphics g)
{
//paints a row of red squares
do
{
do
{
g.setColor (Color.red);
g.drawString ("Hello", (int) (Math.random () * size ().width) + 1, (int) (Math.random () * size ().height) + 1);
g.setColor (Color.white);
g.drawString ("Sweet Fancy Moses", 90, 90);
g.setColor (Color.red);
g.drawString ("Sweet F=ncy Mo=e=", 90, 90);
a++;
}
while (a != 90000);
i = i + 1;
}
while (i == 1);
do
{
do
{
g.setColor (Color.white);
g.drawString ("Goodbye", (int) (Math.random () * size ().width) + 1, (int) (Math.random () * size ().height) + 1);
a--;
}
while (a != 0);
i = i + 1;
a = 0;
}
while (i == 2);
do
{
do
{
for (a = 1 ; a < 250000000 ; a++)
// x+=20 is the same as x = x + 2
{
x = (int) ((Math.random () * size ().width) + 1);
y = (int) (Math.random () * size ().height) + 1;
x1 = (int) x;
y1 = (int) y;
c = (int) (Math.random () * 5 - 1) + 1;
word = (int) (Math.random () * 10 - 1) + 1;
if (c == 1)
{
color = Color.black;
color1 = Color.gray;
color2 = Color.yellow;
color3 = Color.red;
color4 = Color.blue;
color5 = Color.white;
}
else if (c == 2)
{
color1 = Color.black;
color2 = Color.gray;
color3 = Color.yellow;
color4 = Color.red;
color5 = Color.blue;
color = Color.white;
}
else if (c == 3)
{
color2 = Color.black;
color3 = Color.gray;
color4 = Color.yellow;
color5 = Color.red;
color = Color.blue;
color1 = Color.white;
}
else if (c == 4)
{
color3 = Color.white;
color4 = Color.white;
color5 = Color.white;
color = Color.white;
color1 = Color.white;
color2 = Color.white;
}
else
{
color4 = Color.pink;
color5 = Color.pink;
color = Color.pink;
color1 = Color.pink;
color2 = Color.pink;
color3 = Color.pink;
}
if (x > y & x > (y + 250))
{
g.setColor (color);
g.drawRect (x1, y1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
}
else if (x < y & x < (y - 250))
{
g.setColor (color1);
g.drawRect (x1, y1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
/* x is the x-axis co-ordinate
20 is the y-axis co-ordinate
18 is the width of the rectangle
18 is the height of the rectangle*/
}
else if (x > (y - 250) & x < (y + 250))
{
a = a + 1;
g.setColor (color2);
g.drawRect (x1, y1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
}
if (x == y)
{
g.setColor (color3);
g.drawRect (x1, y1 + 1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
}
else if (x != y / 2 & x != y)
{
g.setColor (color4);
g.drawOval (x1, y1 + 1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
}
else
{
g.setColor (color5);
g.drawRect (x1, y1 + 1, (int) (Math.random () * 25 - 1) + 1, (int) (Math.random () * 25 - 1) + 1);
a++;
i = i + 1;
}
g.setColor (Color.black);
g.drawRect (x1, y1 + 1, 1, 1);
if (word == 1)
{
g.drawString ("_", x1, 40);
}
else if (word == 2)
{
g.drawString ("-", x1, y1);
}
else if (word == 3)
{
g.drawString ("/", 40, y1);
}
else if (word == 4)
{
g.drawString ("+", x1, 40);
}
else if (word == 5)
{
g.drawString ("(", x1, y1);
}
else if (word == 6)
{
g.drawString (")", x1, y1);
}
else if (word == 7)
{
g.drawString ("|", 40, y1);
}
else if (word == 8)
{
g.drawString ("*", x1, y1);
}
else if (word == 9)
{
g.drawString (".", (x1 / 14), (y1 / 14));
}
else if (word == 10)
{
g.drawString ("##", x1 / 8, y1 / 8);
}
else
{
}
}
}
while (i != 3);
a = a + 1;
}
while (a != 1);
} // paint method
} // LoopColours class
|
|
_________________
I've abandoned religion in favour of PARTY TIME.
Last edited by Aindriahhn on Sat Apr 17, 2004 1:24 pm; edited 1 time in total |
|
|
 |
 |
Wins 11 - Losses 12 Level 5 |
EXP: 4314 HP: 2100
 |
STR: 700 END: 700 ACC: 1000 AGI: 500
|
Rune Carved Claymour (Sword) (200 - 420) |
|
|
Back to top |
|
 |
Mika Otaku Knight

Joined: 05 May 2003 |
Posted: Fri Apr 16, 2004 5:33 am Post subject: |
what is all that???? scary! |
_________________ <img></img>
"Follow your Bliss"- Jospeh Campbell |
|
|
|
Back to top |
|
 |
KenseiKurisuchan Alive and kicking

Gender:  Joined: 17 Mar 2003 |
Posted: Fri Apr 16, 2004 11:31 pm Post subject: |
This reminds me of that part in the Matrix when Neo was talking to Cypher about the code, saying he didn't understand it. I'm wondering if Ain, Shino, and Sash all see blonde, brunette, blond, red dress in that coding... |
_________________
 |
|
|
 |
 |
Wins 20 - Losses 30 Level 8 |
EXP: 3925 HP: 2265
 |
STR: 665 END: 800 ACC: 600 AGI: 1135
|
Crazy Sticks' Sticks (Blades) (355 - 355) |
|
|
Back to top |
|
 |
|
|
|
|
 |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|