Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 1:59 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: basic java output
PostPosted: Thu Sep 27, 2007 8:14 am 
Offline
Kommunist
Kommunist

Joined: Wed Mar 21, 2007 4:08 pm
Posts: 96
Location: here, not there
ok, in computer science, i need to draw a picture using astrics :shock: . anyone have any suggestions of what i should do?


Top
 Profile  
Reply with quote  
 Post subject: Re: basic java output
PostPosted: Thu Sep 27, 2007 12:21 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Tue Oct 03, 2006 9:39 am
Posts: 312
Location: 4e-2f-41
Do something like:


Code:
{

    System.out.print("*  *  *  *");
    System.out.println("*  *  *...etc");
    System.out.println("*  *  *.....etc");
    System.......etc.;

}



And just keep going that until your output is some ASCII picture made with just astrics. PS: Just keep modifying the space inbetween each astric until you make a picture.

_________________
Quote:
Fix your shitty signature, bitchcakes.

Ok, I did.


Last edited by NEo_Bazz on Fri Sep 28, 2007 12:17 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: basic java output
PostPosted: Fri Sep 28, 2007 10:28 am 
Java sucks. OK, now that we've got that out of the way, "system" needs to be "System"; Java, like most languages, is case-sensitive.


Top
  
Reply with quote  
 Post subject: Re: basic java output
PostPosted: Fri Sep 28, 2007 12:17 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Tue Oct 03, 2006 9:39 am
Posts: 312
Location: 4e-2f-41
Yeah. I couldn't remember if it was upper or lower case. I just guessed lower.
I'll edit+fix it.

_________________
Quote:
Fix your shitty signature, bitchcakes.

Ok, I did.


Top
 Profile  
Reply with quote  
 Post subject: Re: basic java output
PostPosted: Sat Oct 27, 2007 7:56 pm 
Offline
Kommunist
Kommunist

Joined: Wed Mar 21, 2007 4:08 pm
Posts: 96
Location: here, not there
Code:
//********************************************************************
//  Snowman.java       Author: Lewis/Loftus/Cocking
//
//  Demonstrates basic drawing methods and the use of color.
//********************************************************************

import java.applet.Applet;
import java.awt.*;

public class pumpkin extends Applet
{
   //-----------------------------------------------------------------
   //  Draws a pumpkin.
   //-----------------------------------------------------------------
   public void paint (Graphics g)
   {
      final int MID = 150;
      final int TOP = 50;


      setBackground (Color.black);
      g.setColor (Color.white);
      g.drawString ("It's the great pumpkin," ,100,50);
      g.drawString ("Charlie Brown.",120,70);


      g.setColor (Color.green);
      g.fillRect (0, 175, 300, 50);  // ground

      g.setColor (Color.yellow);
      g.fillArc (10, -10, 80, 80, 80, 200);  // moon
     

      g.setColor (Color.orange);
      g.fillOval (MID-70, TOP+90, 60, 50);      // first pumpkin
      g.fillOval (MID+90, TOP+90, 60, 50);   // third pumpkin
      g.fillOval (MID+0, TOP+90, 80, 60);  // second pumpkin

      g.setColor (Color.darkGray);
      g.fillOval (MID-50, TOP+105, 10, 10);   // 1st pumpkin's left eye
      g.fillOval (MID-40, TOP+105, 10, 10);   // 1st pumpkin's right eye
      g.fillOval (MID+20, TOP+103, 15, 15);   // 2nd pumpkin's left eye
      g.fillOval (MID+45, TOP+103, 15, 15);   // 2nd pumpkin's right eye
      g.fillOval (MID+105, TOP+105, 10, 10);   // 3rd pumpkin's left eye
      g.fillOval (MID+125, TOP+105, 10, 10);   // 3rd pumpkin's right eye
     
      g.setColor (Color.black);
      g.fillArc (MID-50, TOP+120, 20, 10, 190, 160);   // smile
      g.fillArc (MID+110, TOP+120, 20, 10, 190, 160);  // 3rd pumpkin's smile
      g.fillArc (MID+25, TOP+110, 30, 30, 190, 160);   // 2nd pumpkin's smile
     
      g.setColor (new Color(247,223,91));
      g.fillOval (MID-130,TOP+60,50,50);              //head
      g.setColor (Color.black);                       
      g.drawArc  (MID-105,TOP+85,20,10,190,160);      //smile
      g.fillOval (MID-105, TOP+75,5,5);               //left eye
      g.setColor (new Color(191,131,13));
      g.fillArc  (MID-130, TOP+140, 50, 30, 0, 90);   //shoe
      g.setColor (new Color(255,222,32));
      g.fillRect (MID-120, TOP+100, 30, 40);   //Charlie's body
   }
}




that's my code for an applet. is it possible to make the words flashing, and if so, how?

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 185 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group