The Warring States of NPF  

Go Back   The Warring States of NPF > Dead threads
User Name
Password
FAQ Members List Calendar Today's Posts Join Chat

 
View First Unread View First Unread   Click to unhide all tags.Click to hide all tags.  
Thread Tools Display Modes
Unread 11-11-2004, 08:22 PM   #1
Bailey
The Obfuscated One
 
Bailey's Avatar
 
Join Date: Oct 2004
Location: Potsdam, NY
Posts: 3,432
Bailey will become famous soon enough. Eventually. Maybe.
Send a message via ICQ to Bailey Send a message via AIM to Bailey Send a message via MSN to Bailey Send a message via Yahoo to Bailey Send a message via Skype™ to Bailey
Default programmers unite!

I am having a problem with this java program






/** this program
* makes the astrixes
* go down the side!
*/


import javax.swing.JOptionPane;

public class Graph {

public static void main( String args[] )
{
int c;
String s1;
int x;

s1 = JOptionPane.showInputDialog( "Enter an integer:" );
c = Integer.parseInt( s1 );



do {
System.out.println(x * "*"); /* I want this to have "x" astrixes, but it yells at me until I take the x* out */
c=c-1;
x=x+1;
} while ( c>0 );
}

}
__________________
Quote:
Originally Posted by POS Industries View Post
I mean, I'm happy to play normal chess when that's the game. But in this case, we've been asked to play chess by someone who then proceeds to hand us a pair of water pistols, tells us the player with the most touchdowns wins, and you're still busy trying to capture my bishop.

Last edited by Bailey; 11-11-2004 at 10:11 PM.
Bailey is offline Add to Bailey's Reputation  
Unread 11-11-2004, 08:29 PM   #2
AndyBloodredMage
NOT on Probation!
 
AndyBloodredMage's Avatar
 
Join Date: Nov 2003
Location: boolean location=true;
Posts: 1,772
AndyBloodredMage is reputed to be..repu..tational. Yes.
Send a message via AIM to AndyBloodredMage
Default

Instead of that SOPln line, make it as follows.

for (int i=x, i>0, i--)
{SOP("*");
SOPln();}
//Make sure its inside the do statement, just cut and paste. It should work.

Dr Edit adds: Whoops, heheh misread your program. Ends up the number of stars increase until it stops! Ain't that silly? So yea, I'm not sure how to fix this, good luck with your programation.
__________________
44% of all percentages are made up on the spot.

Quote:
Originally Posted by The great Shiney
Short one is you're acting like a fuckstick,
^Referring to tidky.
Ahh... How I love our mods.

Did you know that BIG text attracts attention?

Last edited by AndyBloodredMage; 11-11-2004 at 08:39 PM.
AndyBloodredMage is offline Add to AndyBloodredMage's Reputation  
Unread 11-11-2004, 08:36 PM   #3
Bailey
The Obfuscated One
 
Bailey's Avatar
 
Join Date: Oct 2004
Location: Potsdam, NY
Posts: 3,432
Bailey will become famous soon enough. Eventually. Maybe.
Send a message via ICQ to Bailey Send a message via AIM to Bailey Send a message via MSN to Bailey Send a message via Yahoo to Bailey Send a message via Skype™ to Bailey
Default

I ended up going with this for a while


/** this program
* makes the astrixes
* go down the side!
*/


import javax.swing.JOptionPane;

public class Graph {

public static void main( String args[] )
{
int c;
String s1;
int x;
x=1;

s1 = JOptionPane.showInputDialog( "Enter an integer:" );
c = Integer.parseInt( s1 );



do {
System.out.println(x+"*");
c=c-1;
x=x+1;
} while ( c>0 );
}

}




but then I fixed it:


/** this program
* makes the astrixes
* go down the side!
*/



import javax.swing.JOptionPane;

public class Graph {

public static void main( String args[] )
{
int c;
String s1;
int x;
int y;
x=0;
y=0;


s1 = JOptionPane.showInputDialog( "Enter an integer:" );
c = Integer.parseInt( s1 );



do {
while (y>0){
System.out.print("*");
y=y-1;
}
System.out.println("*");
c=c-1;
x=x+1;
y=x;

} while ( c>0 );
}

}
__________________
Quote:
Originally Posted by POS Industries View Post
I mean, I'm happy to play normal chess when that's the game. But in this case, we've been asked to play chess by someone who then proceeds to hand us a pair of water pistols, tells us the player with the most touchdowns wins, and you're still busy trying to capture my bishop.

Last edited by Bailey; 11-12-2004 at 04:36 PM.
Bailey is offline Add to Bailey's Reputation  
Unread 11-12-2004, 04:35 PM   #4
BlackMageGirl!
Oh hi! :D
 
BlackMageGirl!'s Avatar
 
Join Date: Aug 2004
Location: Currently in reality!
Posts: 2,688
BlackMageGirl! has a spectacular disco-style aura about.
Send a message via AIM to BlackMageGirl! Send a message via MSN to BlackMageGirl! Send a message via Skype™ to BlackMageGirl!
Default

Newb, that's great. Only one thing wrong with it. You double posted. Why don't you use the edit button and make it one long post?
BlackMageGirl! is offline Add to BlackMageGirl!'s Reputation  
Unread 11-12-2004, 04:37 PM   #5
Bailey
The Obfuscated One
 
Bailey's Avatar
 
Join Date: Oct 2004
Location: Potsdam, NY
Posts: 3,432
Bailey will become famous soon enough. Eventually. Maybe.
Send a message via ICQ to Bailey Send a message via AIM to Bailey Send a message via MSN to Bailey Send a message via Yahoo to Bailey Send a message via Skype™ to Bailey
Default

oops, my bad. it's fixed now
__________________
Quote:
Originally Posted by POS Industries View Post
I mean, I'm happy to play normal chess when that's the game. But in this case, we've been asked to play chess by someone who then proceeds to hand us a pair of water pistols, tells us the player with the most touchdowns wins, and you're still busy trying to capture my bishop.
Bailey is offline Add to Bailey's Reputation  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:46 AM.
The server time is now 03:46:14 PM.


Powered by: vBulletin Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.