Results 1 to 3 of 3
  1. #1
    angela is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Thumbs up snake and ladder

    Hi i am designing an applet for the game snake and ladder .this is my code-:
    import java.applet.*;
    import java.awt.*;


    public class snake extends Applet{
    public void paint(Graphics g){
    int w = getSize().width;
    int h = getSize().height;
    setBackground(Color.white);
    g.setColor(Color.black);
    g.drawRect(0,0,500,500);
    for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
    g.drawRect(i*50,j*50,50,50);
    }}}}


    Now i have to write the integers 1-100 in the boxes ..
    Can anyone tell me the method to do it...as i am unable to find any method like drawint()...

    Please help

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    You may have better luck getting decent answers for your questions if you provide more detail on the problem and on what you've tried for a solution that doesn't work. A good resource that will give you suggestions on just what information to provide is in my signature links below titled "how to ask smart questions...". Please check it out.

  3. #3
    angela is offline Member
    Join Date
    Apr 2011
    Posts
    4
    Rep Power
    0

    Default understand it better

    Hii

    I am sorry if u cant understand my prob..
    Actually i am just trying to design a snake and ladder box(saap-sidi) in which i have to make 100 boxes and write numbers from 1-100 in each box..
    so i want to know a method to do it...
    i have already made the boxes by above code.

    thnx..

Similar Threads

  1. Snake Game in Java
    By Shyamz1 in forum New To Java
    Replies: 4
    Last Post: 02-10-2011, 02:49 PM
  2. Ladder Program (Need Assistance)
    By Grenade in forum Jobs Discussion
    Replies: 1
    Last Post: 12-14-2010, 10:21 PM
  3. Snake Game Applet
    By Growler in forum Java Applets
    Replies: 6
    Last Post: 07-11-2010, 02:47 PM
  4. Snake Game
    By mustachMan in forum New To Java
    Replies: 2
    Last Post: 12-10-2009, 10:35 PM
  5. Snake game movement
    By BeerMonkey in forum New To Java
    Replies: 9
    Last Post: 11-27-2008, 12:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •