NIM game servlet help...

I'm trying to make a NIM game servlet for class, but i'm having trouble with it.
It's supposed to have a main pile of 21 'sticks' and the player can draw 1-3 sticks, there is a computer player too. so i have to make something simple with radio buttions for 1,2 or 3 sticks and then the servlet does that computation, plus the computer players. In the end the person who can't draw a stick loses...
I assume i have to make an html front end page with the parameters, then have a hidden variable or cookie keeping track of the pile?
I know java applets, but I get confused with servlets... any help would be great, thanks.
jon.

servlets are on server-side (in opposite to applets).
maybe you have a look at pdf.coreservlets.com where you can download a really good ebook for free. it gives you a introduction to servlets on how to use it.

Similar Messages

  • Help Needed to Write Nim Game

    I need help in writing the Nim game. I have the program written already for the user to select if they want to go first or the computer and how many stones the user wants to start with. The problem I am having is writing a loop that recognizes which player is to go first and executes the play of taking stones. Any help would be appreciated.

    Perhaps there could be a boolean firstPlayerMove. Then, when the loop starts, if that is true then the first player enters the stones, otherwise second player. At the end of every time the loop is executed firstPlayerMove should equal "!firstPlayerMove."

  • I got an ipod touch from my friend, but can't figure out how to change the apple id to get games. Help?

    I got an ipod touch from my friend, but can't figure out how to change the apple id to get games. Help?

    Never mind, I got this.

  • HT3702 I'm trying to update a game and its telling me I need to view my billing.i check my billing and it isn't giving me a none option. It's forcing me to put a credit card in, in order to update a game. Help please:(

    I'm trying to update a game and its telling me I need to view my billing.i check my billing and it isn't giving me a none option. It's forcing me to put a credit card in, in order to update a game. Help please:(

    Well, that is probably becasue you owe a debt or something similar.
    Check with
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html

  • Unable to make an in app purchase while I'm in a game! Help

    Unable to make an in app purchase while I'm in a game! Help!!! While in a game if I want to upgrade to full version
    And put in my Apple ID password it states unable to connect to apple store or it has said incorrect user id and password
    But if I go to App Store I can make the purchase. Please help it is frustrating

    Check the settings - perhaps you have enabled restrictions (see: iOS: Understanding Restrictions (parental controls)).
    If not, see iOS: Troubleshooting apps purchased from the App Store

  • WAP/Servlet help is needed URGENT!!!

    I've wrote this little wap-application, which update the library loans via mobile phones. I don't know why my login doesn't work properly (it gives error-messages in any cases). I believe I did everything right.
    Can anyone PLEASE help me finding my mistakes!? I give all my dukes for working version of mine application.
    This are my codes:
    Servlet-class
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class Uusinta extends HttpServlet {
    Connection conn;
    String TUNNUS = "2000000112222";
    String user = null;
    boolean yhteys = false;
    static String [] otsikko = {
    "<?xml version=\"1.0\" encoding=\"utf-8\"?>",
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" \"http://www.wapforum.org/DTD/wml13.dtd\"> " ,
    "<wml>" ,
    "<!-- Possible <head> elements here. --> " ,
    "<template>" ,
    "<do type=\"accept\" label=\"Ok\" name=\"back\" >" ,
    "<prev/>" ,
    "</do>" ,
    "</template>" ,
    "<card id=\"welcome\" title=\"WAP-kirjasto\" newcontext=\"true\">" ,
    "<do type=\"accept\" name=\"back\"><noop/>" ,
    "</do>" ,
    "<p align=\"center\"><strong>TERVETULOA</strong></p>",
    "<p><br/>Kirjastokortin numero:<br/>" ,
    "<input type=\"text\" name=\"numero\" size=\"11\" format=\"*N\" maxlength=\"13\"/><br/>" ,
    "Salasana:<br/>" ,
    "<input type=\"text\" name=\"salasana\" size=\"4\" format=\"*N\" maxlength=\"4\"/><br/>" ,
    "<a href=\"skripti.wmls#Login('$(numero)','$(salasana)','kayttaja')\">Sisaan </a></p>" ,
    "</card>" ,
    "<card id=\"loginError\">" ,
    "<do type=\"prev\" label=\"Back\">" ,
    "<go href=\"#welcome\"/>" ,
    "</do>" ,
    "<p align=\"center\"><br/>Korttinumero tai salasana on vaara.</p>" ,
    "</card>" ,
    "<card id=\"lainat\" newcontext=\"true\">" ,
    "<do type=\"accept\" name=\"back\"><noop/>" ,
    "</do>" ,
    "<do type=\"options\" label=\"Lopeta\">" ,
    "<go href=\"#goodbye\"/>" ,
    "</do>" ,
    "<p><b>Lainatut kirjat:</b></p><p> " ,
    "<select name=\"item\" title=\"Lista\">"};
    static String [] r2 = {
    "</select>" ,
    "<br/><a href=\"skripti.wmls#uusiNide('$(item)','valittu')\">Uusi valittu</a><br/>" ,
    "<a href=\"skripti.wmls#uusiKaikki()\">Uusi kaikki</a></p>" ,
    "</card>" ,
    "<card id=\"virhe\">" ,
    "<p>Kirjan uusiminen ei onnistunut. Yrit&#xE4; uudelleen.</p>" ,
    "</card>" ,
    "<card id=\"uusittu\">" ,
    "<do type=\"prev\" label=\"Back\">",
    " <go href=\"#lainat\"/>",
    "</do>",
    "<p align=\"center\"><br/>Kirja on uusittu.</p>" ,
    "</card>" ,
    "<card id=\"virheet\">" ,
    "<p>Kirjojen uusiminen ei onnistunut. Yrit&#xE4; uudelleen.</p>" ,
    "</card>" ,
    "<card id=\"uusitut\">" ,
    "<do type=\"prev\" label=\"Back\">",
    " <go href=\"#goodbye\"/>",
    "</do>",
    "<p align=\"center\"><br/>Kirjat on uusittu.</p>" ,
    "</card>" ,
    "<card id=\"goodbye\" newcontext=\"true\">" ,
    "<do type=\"accept\" name=\"back\"><noop/>" ,
    "</do>" ,
    "<p align=\"center\"><br/>Kiitos k�ynnist�. Ja tervetuloa uudelleen.</p>" ,
    "</card>" ,
    "</wml>"};
    private void teeWML(PrintWriter out)
    Statement stmt;
    ResultSet result;
    boolean ok = false;
    for (int i = 0; i <otsikko.length;i++)
         out.println(otsikko);
         if(yhteys)
    try {
    stmt= conn.createStatement();
    result = stmt.executeQuery("Select * FROM lainat l join kirja k on l.nide = k.nide where tunnus = '"+this.user+"'");
    int cnt = 1;
    while(result.next())
              ok = true;
                   String nimi ="";
         if(result.getString("nimi").length() > 8)
         nimi = result.getString("nimi").substring(0,8) + "...";
         else
         nimi = result.getString("nimi");
              out.println("<option value=\""+result.getString("l.nide")+"\">"+nimi+":"
              result.getString("erapaiva")"</option>");
    result.close();
    stmt.close();
    }catch (SQLException ex) {
    System.out.println ("\nSQLException:");
    while (ex != null) {
    System.out.println ("SQLState: "+ ex.getSQLState());
    System.out.println ("Message: "+ ex.getMessage());
    System.out.println ("Vendor: "+ ex.getErrorCode());
    ex = ex.getNextException();
    else
              out.println("<option value=\"0\">nothing</option>");
         for (int i = 0; i <r2.length;i++)
              out.println(r2[i]);
    out.close();
    private void uusiNide(PrintWriter out, String nide)
    Statement stmt;
    ResultSet result;
    boolean ok=false;
         try {
    stmt= conn.createStatement();
    result = stmt.executeQuery("Select nide from lainat where tunnus='"+user+"' ");
    int cnt = 1;
    while(result.next())
              ok = true;
    result.close();
    stmt.close();
         if(ok)
              String pvm = getPvm();
              stmt = conn.createStatement();
              int a = stmt.executeUpdate("update lainat set erapaiva='"+pvm+"' where tunnus='"+user+"' AND nide='"+nide+"'");
    }catch (SQLException ex) {
    System.out.println ("\nSQLException:");
    while (ex != null) {
    System.out.println ("SQLState: "+ ex.getSQLState());
    System.out.println ("Message: "+ ex.getMessage());
    System.out.println ("Vendor: "+ ex.getErrorCode());
    ex = ex.getNextException();
         if(ok) {
         out.println("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">");
              out.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><title>koe</title></head><body><p>OKnide</p></body></html>");
    private void uusiKaikkiNiteet(PrintWriter out)
    Statement stmt;
    ResultSet result;
    boolean ok=false;
    //t�h�n tulee viel� korttinumero
         try {
              String pvm = getPvm();
         stmt = conn.createStatement();
              int a = stmt.executeUpdate("update lainat set erapaiva='"+pvm+"' where tunnus='"+user+"'");
    }catch (SQLException ex) {
    System.out.println ("\nSQLException:");
    while (ex != null) {
    System.out.println ("SQLState: "+ ex.getSQLState());
    System.out.println ("Message: "+ ex.getMessage());
    System.out.println ("Vendor: "+ ex.getErrorCode());
    ex = ex.getNextException();
    if(ok) {
              out.println("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">");
              out.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><title>koe</title></head><body><p>OKKaikki</p></body></html>");
    private void tarkKayttaja(PrintWriter out, String kayttaja, String password)
    Statement stmt;
    ResultSet result;
    boolean ok=false;
    String nimi = null;
    if(user !=null && password !=null)
    int salasana = Integer.parseInt(password);
    try {
    stmt= conn.createStatement();
    result = stmt.executeQuery("Select * from kortti where numero='"+kayttaja+"' and salasana="+salasana);
    while(result.next())
              ok = true;
              nimi = result.getString("nimi");
    }catch (SQLException ex) {
         System.out.println ("\nSQLException:");
         while (ex != null) {
         System.out.println ("SQLState: "+ ex.getSQLState());
         System.out.println ("Message: "+ ex.getMessage());
         System.out.println ("Vendor: "+ ex.getErrorCode());
         ex = ex.getNextException();
         if(ok) {
                   this.user= kayttaja;
                   yhteys = true;
                   //teeWML(out);
         out.println("<!doctype html public \"-//w3c//dtd html 4.0 transitional//en\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">");
              out.println("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><title>koe</title></head><body><p>OK</p></body></html>");
              //out.close();
         teeWML(out);
    public void init(ServletConfig cfg) throws ServletException
    try{
    Driver d = (Driver)Class.forName("com.mysql.jdbc.Driver").newInstance();
    String sCon = "jdbc:mysql://localhost/kirjasto?user=oppilas&password=oppix";
    conn = DriverManager.getConnection(sCon);
    }catch(Exception e){
    System.out.println ("Exception: "+ e.getMessage());
    throw new ServletException(e.getMessage());
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException
    PrintWriter out = null;
         String kutsu = req.getParameter("toiminto");
         String uusinta = req.getParameter("uusinta");
         String password = req.getParameter("password");
         String kayttaja = req.getParameter("user");
         if (kutsu == null) {
         res.setContentType("text/vnd.wap.wml");
         out = res.getWriter();
              tarkKayttaja(out, null, null);
         if(kutsu.equalsIgnoreCase("login")) {
         res.setContentType("text/html");
         out = res.getWriter();
              tarkKayttaja(out, kayttaja, password);
         if(kutsu.equalsIgnoreCase("uusi")) {
         res.setContentType("text/html");
         out = res.getWriter();
              uusiNide(out, uusinta);
         if(kutsu.equalsIgnoreCase("uusiKaikki")){
              res.setContentType("text/html");
              out = res.getWriter();
              uusiKaikkiNiteet(out);
    public void destroy()
    try{
    conn.close();
    }catch(SQLException e){
    System.out.println ("\nSQLException:");
    System.out.println ("SQLState: "+e.getSQLState());
    System.out.println ("Message: "+ e.getMessage());
    System.out.println ("Vendor: "+ e.getErrorCode());
    public String getPvm()
         Calendar x = Calendar.getInstance();
         x.add(Calendar.DATE, 30);
              int Day = x.get(Calendar.DAY_OF_YEAR);
              Day = Day+30;
              x.set(Calendar.DAY_OF_YEAR, Day);
              int monthDue = x.get(Calendar.MONTH);
              int dayOfMonthDue = x.get(Calendar.DAY_OF_MONTH);
              int yearDue = x.get(Calendar.YEAR);
                   System.out.println(yearDue+"-"+monthDue+"-"+dayOfMonthDue);
              return (yearDue+"-"+monthDue+"-"+dayOfMonthDue);
    skriptit.wmls
    extern function uusiNide(prmIn,valittu) {
         var str, result, okInd, pInd;
         str = "http://localhost:8080/kirjasto/loans?toiminto=uusi&uusinta=" +URL.escapeString(prmIn);
         var load = URL.loadString(str,"text/html");
         okInd =String.find(load, "OKnide");
         if( okInd != -1 ) {
              result = WMLBrowser.setVar(valittu, prmIn);
              WMLBrowser.go("#uusittu");
         else {
              WMLBrowser.go("#virhe");
         return "";
    extern function uusiKaikki() {
         var str, result, okInd, pInd, val, valittu;
         str = "http://localhost:8080/kirjasto/loans?toiminto=uusiKaikki&uusinta=";
         var load = URL.loadString(str,"text/html");
         okInd =String.find(load, "OKKaikki");
         if( okInd != -1 ) {
              WMLBrowser.go("#uusitut");
         else {
              WMLBrowser.go("#virheet");
         return "";
    extern function Login(prmNum, prmPass, kayttaja) {
         var str, result, okInd, pInd, pos, nimi;
         str = "http://localhost:8080/kirjasto/loans?toiminto=login&user="+URL.escapeString(prmNum)+"&password="+URL.escapeString(prmPass);
         var load = URL.loadString(str,"text/html");
         okInd =String.find(load, "OK");
         if( okInd != -1 ) {     
              pos = String.find(load, "</p");
              nimi = String.subString(load,(okInd + 7), (pos - okInd -7));
              result = WMLBrowser.setVar(kayttaja, nimi);
              WMLBrowser.go("#lainat");
         else {
              WMLBrowser.go("#loginError");
         return "";
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
    'http://java.sun.com/j2ee/dtds/web-app_2_3.dtd'>
    <web-app>
    <display-name>Verkkopizzeria</display-name>
    <servlet>
    <servlet-name>Vastaa</servlet-name>
    <servlet-class>Vastaa</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Uusinta</servlet-name>
    <servlet-class>Uusinta</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Vastaa</servlet-name>
    <url-pattern>/vastaa</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Uusinta</servlet-name>
    <url-pattern>/loans</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    DB create and inserts
    create table kortti(
    numero char(13) not null,
    nimi char(25),
    osoite char(25),
    postinro int(5),
    puhelin char(15),
    salasana int(4),
    primary key(numero)
    create table kirja(
    nide char(10) not null,
    nimi char(25) not null,
    tekija char(25) not null,
    vuosi int(4) not null,
    primary key(nide)
    create table lainat(
    tunnus char(13) not null,
    nide char(10) not null,
    erapaiva date not null,
    primary key (tunnus, nide),
    foreign key (tunnus) references kortti,
    foreign key (nide) references kirja );
    insert into kortti
    (numero, nimi, osoite, postinro, puhelin, salasana)
    values
    ('2000000112222', 'Aku Ankka', 'Akunkatu 11', 00980, '0401231234', 2222);
    insert into kortti
    (numero, nimi, osoite, postinro, puhelin, salasana)
    values
    ('2000000113333', 'Roope Set�', 'Mikonkatu 11', 00100, '0405552223', 3333);
    insert into kortti
    (numero, nimi, osoite, postinro, puhelin, salasana)
    values
    ('2000000114444', 'Mikki Hiiri', 'Kissankuja 5', 00930, '04009876545', 4444);
    insert into kortti
    (numero, nimi, osoite, postinro, puhelin, salasana)
    values
    ('2000000115555', 'Ville Vallaton', 'Mestarinrinne 4', 00310, '0952223335', 5555);
    insert into kirja
    (nide, nimi, tekija, vuosi)
    values
    ('1111-85555','Wap', 'Pekka Niskanen', 2000);
    insert into kirja
    (nide, nimi, tekija, vuosi)
    values
    ('1111-45345','Java 2', 'Pekka Niskanen', 2002);
    insert into kirja
    (nide, nimi, tekija, vuosi)
    values
    ('1111-64648','J�rki ja tunteet', 'Jane Austin', 1998);
    insert into kirja
    (nide, nimi, tekija, vuosi)
    values
    ('1111-15671','Rikos ja rangastus', 'Leo Tolstoy', 1998);
    insert into kirja
    (nide, nimi, tekija, vuosi)
    values
    ('1111-85554','Inside Wap', 'Pekka Niskanen', 2002);
    insert into lainat
    (tunnus, nide, erapaiva)
    values
    ('2000000112222', '1111-85555', '2004-5-01-11');
    insert into lainat
    (tunnus, nide, erapaiva)
    values
    ('2000000112222', '1111-45345', '2004-5-01-11');
    insert into lainat
    (tunnus, nide, erapaiva)
    values
    ('2000000112222', '1111-64648', '2004-5-01-12');
    insert into lainat
    (tunnus, nide, erapaiva)
    values
    ('2000000113333', '1111-85554', '2004-5-01-11');
    insert into lainat
    (tunnus, nide, erapaiva)
    values
    ('2000000114444', '1111-15671', '2004-5-01-12');

    So many things wrong with this post... from [url http://www.catb.org/~esr/faqs/smart-questions.html#urgent]How to Ask Questions the Smart Way:
    Don't flag your question as ?Urgent?, even if it is for you
    That's your problem, not ours. Claiming urgency is very likely to be counter-productive: most hackers will simply delete such messages as rude and selfish attempts to elicit immediate and special attention.
    There is one semi-exception. It can be worth mentioning if you're using the program in some high-profile place, one that the hackers will get excited about; in such a case, if you're under time pressure, and you say so politely, people may get interested enough to answer faster.
    This is a very risky thing to do, however, because the hackers' metric for what is exciting probably differ from yours. Posting from the International Space Station would qualify, for example, but posting on behalf of a feel-good charitable or political cause would almost certainly not. In fact, posting ?Urgent: Help me save the fuzzy baby seals!? will reliably get you shunned or flamed even by hackers who think fuzzy baby seals are important.
    If you find this mysterious, re-read the rest of this how-to repeatedly until you understand it before posting anything at all.
    Be precise and informative about your problem
    Describe the symptoms of your problem or bug carefully and clearly.
    Describe the environment in which it occurs (machine, OS, application, whatever). Provide your vendor's distribution and release level (e.g.: ?Fedora Core 1?, ?Slackware 9.1?, etc.).
    Describe the research you did to try and understand the problem before you asked the question.
    Describe the diagnostic steps you took to try and pin down the problem yourself before you asked the question.
    Describe any recent changes in your computer or software configuration that might be relevant.
    Do the best you can to anticipate the questions a hacker will ask, and to answer them in advance in your request for help.
    Simon Tatham has written an excellent essay entitled How to Report Bugs Effectively. I strongly recommend that you read it.
    Volume is not precision
    You need to be precise and informative. This end is not served by simply dumping huge volumes of code or data into a help request. If you have a large, complicated test case that is breaking a program, try to trim it and make it as small as possible.
    This is useful for at least three reasons. One: being seen to invest effort in simplifying the question makes it more likely that you'll get an answer, Two: simplifying the question makes it more likely you'll get a useful answer. Three: In the process of refining your bug report, you may develop a fix or workaround yourself
    And from [url http://www.thejword.com]The J Word:
    Code Tags
    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

  • Retrieving cell values from html in servlet - help!

    Dear all,
    I've got a table. I want to put links in each cell box. No problem. However I want to know when i've moved to my link what number cell the link came from. This is proving to be a big problem.
    Here is what i've tried:
    writer.println("<TR><TH bgcolor=\"brown\">Brown<TD id=1><li>
    <a href=BookingFromScreen>1</a></li></TD>" +
    "<TD name = \"id\" value = \"2\"><li><a href=BookingFromScreen>2</a></li></TD>".. etc...
    then picking the id's up in BookingFromScreen like this:
    String cell = request.getParameter("id");
    String cellNo= request.getParameter("value");
    System.out.println("this is the cell parameter: " +cell);
    System.out.println("this is the cell Number: " +cellNo);
    Object cell1 = request.getAttribute("id");
    String cell2 = (String)cell1;
    System.out.println("this may work: "+cell2);
    neither of these ways work, once link has been clicked all the information about that cell is lost, can anyone pleeeeeeeeeease tell me why this isn't working? both are in the doGet methods of their respective servlets if thats any help....
    thank you
    Jen C

    just use
    writer.println("<TR><TH bgcolor=\"brown\">Brown<TD id=1><li>
    <a href=BookingFromScreen?id=1>1</a></li></TD>" +
    "<TD name = \"id\" value = \"2\"><li><a href=BookingFromScreen?id=2>2</a></li></TD>"also you should be using a jsp for this

  • Just installed the latest Version of Firefox and it wont play any videos or games? Help, so tired and frustrated with this web browser.

    I just installed the newest version of Firefox version30. It wont play videos on youtube but i figured out what to do to fix that (change to "never activate" on Shockwave Flash add-on in plugins).
    But if i leave that setting on then the game that i try to play on Facebook tells me turn on flash and when i do i still get a blank screen on FB. What do i need to do?
    Im sure theres a simple answer. Ive tried at least 6 different things by reading others solutions and they have not worked. I dont get why why im still having problems WHEN I JUST FRESHLY INSTALLED THE NEWEST FIREFOX AVAILABLE FROM YOUR SITE!!
    These annoyances are exactly the reason I and many others have left Firefox for Chrome after being loyal for many years. Help please!

    Try to set the Flash plug to click-to-play by setting the permissions for Flash to "Ask To Activate" in "Firefox/Tools > Add-ons > Plugins". That way you can activate the Flash plugin when you need it via the Lego block icon on the location bar.
    Also, I don't even see Flash listed as installed on Firefox. Are you sure you have it installed? Try downloading it from the below site
    *get.adobe.com/flashplayer

  • HT4759 Game Center games iCloud help

    I have my games in Game Center but don't know how to download it from there and I have a new IPad so tried downloading through iCloud but can't seem to be able to get into it help please

    Hey there Sanchezmoya!
    I have a couple of articles here that may help you with this question. If you need to re-download the actual apps for the games you are wishing to play, you can find those in the past purchases of your Apple ID:
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    If you have a backup you can restore from (if you had an iPad previously), then you can see this article for information on how to restore from your previous backup and access your game saves:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Game Center Help!

    I can't log into my Game Center account.
    I opened Game Center one day to see that I had been logged out. I didn't think much of this and just went ahead and hit the "Sign In" button, but when I did, this message came up:
    "This Apple ID has not yet been used in Game Center. Tap Continue to set up your account."
    I was quite confused when I saw this, seeing as how I had used my Game Center account for several months. I've tried googling the problem and haven't found any solutions. I've tried quitting Game Center and all supported games and relogging but it hasn't done much.
    I've also made a different account and tried logging in with it, and it worked. I tried logging back into my original account and I still have the same problem. I don't want to go ahead and recreate the Game Center account because I have a lot of games linked with it, not to mention all my friends.
    I was wondering if anyone had a solution to this problem. The only slightly helpful post I've seen tells me to make an account in sandbox mode, logout and try logging in again via a Game Center supported game, but I can't figure out how to make a sandbox account. Any comments/help would be greatly appreciated.

    Ok thax alot i will try it

  • Trying to create object of a class within servlet - help!!

    I have created and compiled the following classes within
    C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\classes
    1)LoginServlet
    2)LoginManager
    3)I have LoginServlet trying to create an object of type LoginManager, very simple,
    but I get the following errors:
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    4)I have the .java and .class files located within the same directory, so I don't
    see what's wrong here??? HELP!
    LoginManager looks like:
    public class LoginManager {
    public boolean authenticateUser(String username, String password){
              boolean status = false;
    //simple code for string matching
              return status;
    LoginServlet looks like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
         // Constructors
         // Variables
         public static final String CONTENT_TYPE = "text/html";
         public boolean LOGIN_STATUS;
         // Methods
         public void service (HttpServletRequest req, HttpServletResponse res)
              throws IOException {
              String username = "";
              String password = "";
              LoginManager lm = new LoginManager();
              username = req.getParameter("username");
              password = req.getParameter("password");
              LOGIN_STATUS = lm.authenticateUser(username, password);
              res.setContentType(CONTENT_TYPE);
              PrintWriter out = res.getWriter();
              out.println("<html><head><title>Hello World</title></head>" +
                             "<body>Hello! Your login status is " + LOGIN_STATUS +
                             "</body>" +
                             "</html>");
         public void init (ServletConfig config) throws ServletException {
              super.init(config);

    Do you have . in the CLASSPATH when compiling your servlet?
    ron <[email protected]> wrote:
    I have created and compiled the following classes within
    C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\classes
    1)LoginServlet
    2)LoginManager
    3)I have LoginServlet trying to create an object of type LoginManager, very simple,
    but I get the following errors:
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    Cannot resolve symbol: LoginManager lm = new LoginManager();
    ^
    4)I have the .java and .class files located within the same directory, so I don't
    see what's wrong here??? HELP!
    LoginManager looks like:
    public class LoginManager {
    public boolean authenticateUser(String username, String password){
              boolean status = false;
    //simple code for string matching
              return status;
    LoginServlet looks like:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class LoginServlet extends HttpServlet {
         // Constructors
         // Variables
         public static final String CONTENT_TYPE = "text/html";
         public boolean LOGIN_STATUS;
         // Methods
         public void service (HttpServletRequest req, HttpServletResponse res)
              throws IOException {
              String username = "";
              String password = "";
              LoginManager lm = new LoginManager();
              username = req.getParameter("username");
              password = req.getParameter("password");
              LOGIN_STATUS = lm.authenticateUser(username, password);
              res.setContentType(CONTENT_TYPE);
              PrintWriter out = res.getWriter();
              out.println("<html><head><title>Hello World</title></head>" +
                             "<body>Hello! Your login status is " + LOGIN_STATUS +
                             "</body>" +
                             "</html>");
         public void init (ServletConfig config) throws ServletException {
              super.init(config);
    Dimitri

  • Sending a file from Applet to servlet HELP me Please

    Sorry, i have the problem this is my code Applet & Servlet but it seems working asynchronously if you have some ideas please reply me i send bytes on outputstream but the inputstream of servlet receive nothing bytes but write my system.out.print on screen server:
    Applet:
    URL servletURL = new URL(codebase, "/InviaFile/servlet/Ricevi");
    HttpURLConnection urlConnection = (HttpURLConnection) servletURL.openConnection();
    urlConnection.setRequestMethod("POST");
    urlConnection.setUseCaches(false);
    urlConnection.setDoOutput(true);
    urlConnection.setDoInput(true);
    urlConnection.setAllowUserInteraction(false);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    urlConnection.setRequestProperty("Content-length", String.valueOf(100));
    urlConnection.connect();
    if(urlConnection.HTTP_BAD_REQUEST == HttpURLConnection.HTTP_BAD_REQUEST){
    /*System.out.println("Cattiva Richiesta: "+urlConnection.getContentEncoding());
    System.out.println("Tipo di metodo: "+urlConnection.getRequestMethod());
    System.out.println("Tipo di Risposta: "+urlConnection.getResponseCode());
    System.out.println("Tipo di messaggio: "+urlConnection.getResponseMessage());
    System.out.println("Tipo di contenuto: "+urlConnection.getContentType());
    System.out.println("Tipo di lunghezza contenuto: "+urlConnection.getContentLength());
    System.out.println("Tipo di doinput: "+urlConnection.getDoInput());
    System.out.println("Tipo di doouput: "+urlConnection.getDoOutput());
    System.out.println("Tipo di URL: "+urlConnection.getURL());
    System.out.println("Tipo di propriet� richiesta: "+urlConnection.getRequestProperty("Content-Type"));
    System.out.println("Entra if");
    DataOutputStream dout = new DataOutputStream(urlConnection.getOutputStream());
    InputStream is = urlConnection.getInputStream();
    if(ritornaFile("C:/Ms.tif", dout))System.out.println("Finita lettura");
    dout.close();
    urlConnection.disconnect();
    System.out.println("Fine Applet");
    }catch(Exception e) { System.err.println(e.getMessage());e.printStackTrace();}
    public boolean ritornaFile(String file, OutputStream ots)throws Exception{
    FileInputStream f = null;
    try{
    f = new FileInputStream(file);
    byte[] buf = new byte[4 * 1024];
    int byteLetti;
    while((byteLetti = f.read()) != -1){ots.writeByte(buf, 0, byteLetti);ots.flush();
    while((byteLetti = f.read()) != -1){ots.write(byteLetti);ots.flush();
    System.out.println("byteLetti= "+byteLetti);
    return true;
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    return false;
    }finally{
    if(f != null)f.close();
    Servlet:
    HttpSession ses = request.getSession(true);
    System.out.println("Passa servlet "+request.getMethod());
    System.out.println("Passa servlet "+ses.getId());
    ServletInputStream servletinputstream = request.getInputStream();
    DataInputStream dis = new DataInputStream(request.getInputStream());
    int c = dis.available();
    System.out.println("c="+c);
    //ServletOutputStream servletoutputstream
    //response.getOutputStream();
    response.setContentType("application/octet-stream");
    System.out.println("URI= "+request.getRequestURI());
    System.out.println("pathTranslated: "+request.getPathTranslated());
    System.out.println("RemoteUser: "+request.getRemoteUser());
    System.out.println("UserInRole: "+String.valueOf(request.isUserInRole("")));
    System.out.println("pathInfo: "+request.getPathInfo());
    System.out.println("Protocollo: "+request.getProtocol());
    System.out.println("RemoteAddr:"+request.getRemoteAddr());
    System.out.println("RemoteHost:"+request.getRemoteHost());
    System.out.println("SessionID:"+request.getRequestedSessionId());
    System.out.println("Schema:"+request.getScheme());
    System.out.println("SeesionValido:"+String.valueOf(request.isRequestedSessionIdValid()));
    System.out.println("FromURL:"+String.valueOf(request.isRequestedSessionIdFromURL()));
    int i = request.getContentLength();
    System.out.println("i: "+i);
    ritornaFile(servletinputstream, "C:"+File.separator+"Pluto.tif");
    System.out.println("GetMimeType= "+getServletContext().getMimeType("Ms.tif"));
    InputStream is = request.getInputStream();
    int in = is.available();
    System.out.println("Legge dallo stream in="+in);
    DataInputStream diss = new DataInputStream(servletinputstream);
    int ins = diss.read();
    System.out.println("Legge dallo stream ins="+ins);
    int disins = diss.available();
    System.out.println("Legge dallo stream disins="+disins);
    is.close();
    System.out.println("Fine Servlet");
    catch(Exception exception) {
    System.out.println("IOException occured in the Server: " + exception.getMessage());exception.printStackTrace();
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    public void ritornaFile(InputStream its, String fileDest )throws Exception{
    FileOutputStream f = null;
    try{
    f = new FileOutputStream(fileDest);
    byte[] buf = new byte[2 * 1024];
    int byteLetti;
    while((byteLetti = its.read()) != -1){
    f.write(buf, 0, byteLetti);
    f.flush();
    System.out.println("Byteletti="+byteLetti);
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    }finally{
    if(f != null)f.close();

    Hi all,
    Can anyone help me.I am trying to send an audio file from a applet to servlet with HTTP method(no raw sockets), also the servlet shld be able to save the file on the server.Any suggestions welcome.USing audiostream class from javax.sound.sampled.
    The part of applet code which calls servlet is :
    URL url = new URL("http://" + host + "/" + context + "/servlet/UserUpdateWorkLogAudio?userid=" + userId.replace(' ', '+') + "&FileName=" + filename.replace(' ', '+'));
    URLConnection myConnection = url.openConnection();
    myConnection.setUseCaches(false);
    myConnection.setDoOutput(true);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    myConnection.connect();
    out = new BufferedOutputStream(myConnection.getOutputStream());
    AudioSystem.write(audioInputStream, fileType,out); // IS THIS RIGHT APPROACH?
    ************************end of applet code**********************
    ************************servlet code******************************
    try
    {BufferedInputStream in = new BufferedInputStream(request.getInputStream());
    ????????What code shld i write here to get the audio file stream
    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(filename));
    *********************************************end***********************
    Thanks
    Joe.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I've just bought "order and chaos. But when i try to install it to the iphone 3gs it says that im not compatible . I got the version 3.1.3 on my iphone and it says that i should atleast have that version to run the game. HELP ME!!!!!!

    Hi, i've just bought the game "Order and chaos" on i-tunes for my iphone 3gs. But when i try to install it to my Iphone it says that im not compatible.I need to know what the problem is. Help me please, i dont like to pay for something that dosn't work!

    i have downloaded the most current version and when i try to install it, it tells me my computer software is not new enough but it will not show me any software updates?
    Is that a Mac OS or a Windows OS you're running on that computer, dawn? If it's a Mac OS, what do you have? 10.5.8 Leopard or something higher?

  • Board game - pawn help.. I need some experts here.. i need this now.. beg..

    i have these whole junk of coding here.. where should i insert my pawns? lets say pinkpawn.jpg is my pawn.. then what code should i type & at where?
    import java.util.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.Timer;
    import java.util.TimerTask;
    class ImageDemo extends JPanel implements ActionListener
              Random rand = new Random();
              int num = 0, range = 500, score = 0;
              JLabel labelScore;
              JButton button1;
              public ImageDemo()
              //---------------Zarrina-------------------
    num = rand.nextInt(range);
                   num %= 6;
                   num += 1;
                   System.out.println("The random number is " + num);
              //-----------------Simei------------------
                   labelScore = new JLabel();
                   labelScore.setText("125");
                   labelScore.setBounds(525, 160, 70, 30);
                   add(labelScore);
                   setLayout(null);
                   button1 = new JButton("haha");
                   button1.setBounds(400, 200, 75, 75);
                   button1.addActionListener(this);
                   button1.setBackground(Color.red);
                   add(button1);
                   // huahua mus b here
              public void paintComponent(Graphics comp)
                   //---------------Carolin-----------------
                   super.paintComponent(comp);
                   for (int i = 0; i < 7; i++)
                        if(i%2 == 0)
                             comp.setColor(Color.blue);
                             comp.fillRect((50+i*70), 50, 100, 60);
                        else if (i%2 == 1)
                             comp.setColor(Color.yellow);
                             comp.fillRect((50+i*70), 50, 100, 60);
              public void actionPerformed(ActionEvent e)
                   if ((JButton)e.getSource() == button1)
                             score += 5;
                             labelScore.setText("" + score);
    er(this);
                   add(die);
                   for (i = 0; i < 6; i++)
                        LayOut[i] = new JLabel();
                        LayOut.setBounds(50, 350+(-60*i), 80, 60);
                        add(LayOut[i]);
                   LayOut[CurrentPosition].setIcon(picture);
                   for (i = 6; i < 10; i++)
                        LayOut[i] = new JLabel();
                        LayOut[i].setBounds(130+(80*a), 50, 80, 60);
                        add(LayOut[i]);
                        a++;
                   a = 0;
                   for (i = 10; i < 16; i++)
                        LayOut[i] = new JLabel();
                        LayOut[i].setBounds(450, 50+(60*a), 80, 60);
                        add(LayOut[i]);
                        a++;
                   a = 0;
                   for (i = 16; i < 20; i++)
                        LayOut[i] = new JLabel();
                        LayOut[i].setBounds(370+(-80*a), 350, 80, 60);
                        add(LayOut[i]);
                        a++;
         public void ChangeNumber()
              //---------------Zarrina-------------------
              num = rand.nextInt(range);
                   num %= 6;
                   num += 1;
              public void paintComponent(Graphics comp)
                   //---------------Carolin-----------------
                   super.paintComponent(comp);
                   comp.drawImage(bgImage, 0, 0, this);
                   for (int i = 0; i < 6; i++)
                        comp.drawRect(50+(80*i), 50, 80, 60);     
                   for (int i = 0; i < 6; i++)
                        comp.drawRect(50+(80*i), 350, 80, 60);     
                   for (int i = 0; i < 4; i++)
                        comp.drawRect(50, 110+(i*60), 80, 60);     
                   for (int i = 0; i < 4; i++)
                        comp.drawRect(450, 110+(i*60), 80, 60);     
                   comp.drawString("Moral Qns", 68, 75);
                   comp.drawString("time", 78, 90);
                   comp.drawString("Get 1 Moral", 142, 69);
                   comp.drawString("credit free!!", 145, 90);
                   comp.drawString("Gain 10", 229, 72);
                   comp.drawString("Credits", 229, 92);
                   comp.drawString("Question", 307, 72);
                   comp.drawString("Time", 317, 90);
                   comp.drawString("Lose 4", 387, 72);
                   comp.drawString("Credit", 387, 90);
                   comp.drawString("Ans 1", 464, 72);
                   comp.drawString("Moral Qns", 458, 90);
                   comp.drawString("Moral Qns", 458, 130);
                   comp.drawString("Time", 468, 150);
                   comp.drawString("Lose 3", 461, 187);
                   comp.drawString("Moral credit", 459, 204);
                   comp.drawString("=(", 466, 217);
                   comp.drawString("Moral Qns", 459, 255);
                   comp.drawString("Time", 465, 270);
                   comp.drawString("Lose 5", 465, 308);
                   comp.drawString("credits", 465, 322);
                   comp.drawString("TRAGEDY!!", 455, 338);
                   comp.drawString("Ans 1", 465, 376);
                   comp.drawString("Moral Qns", 465, 393);
                   comp.drawString("Lose 2", 384, 376);
                   comp.drawString("Credits", 382, 393);
                   comp.drawString("Ans 1", 305, 376);
                   comp.drawString("Moral Qns", 304, 393);
                   comp.drawString("Answer 1", 230, 376);
                   comp.drawString("Question", 227, 393);
                   comp.drawString("Gain 8", 145, 366);
                   comp.drawString("Credits", 145, 383);
                   comp.drawString("=)", 145, 399);
                   comp.drawString("START", 68, 384);
                   comp.drawString("Gain 6", 68, 310);
                   comp.drawString("Credits", 68, 330);
                   comp.drawString("Question", 68, 254);
                   comp.drawString("Time", 72, 272);
                   comp.drawString("Move 3", 68, 189);
                   comp.drawString("Steps Ahead", 58, 210);
                   comp.drawString("Ans 1 Qns", 57, 130);
              //---------------score-----------------
              public void actionPerformed(ActionEvent e)
                   if ((JButton)e.getSource() == die)
                        LayOut[CurrentPosition].setVisible(false);
                        ChangeNumber();
                        CurrentPosition += num;
                        if (CurrentPosition > 19)
                             CurrentPosition -= 20;
                        System.out.println("The Current position is " + CurrentPosition);
                        if (CurrentPosition == 1)
                             score += 6;
                             //Credit -= 6;
                        else if (CurrentPosition == 2)
                             AskQuestionBasic ask=new AskQuestionBasic
                             ("You board the bus after school and saw that there are a lot of people in the bus.And most of them were from your school. The bus is so crowded that there isn't any seats left. However, you saw an empty space and you witness a working adult rushing for the seat with an old lady, and he got it first. What will you do?", 2, "Tell the adult nicely that he should not have done so.", "Try to search for another place for the old lady.", "Pretend that you had never seen anything.", "Ask 1 of your friend to kindly give up the seat to her.","BUS1.GIF");
                        else if (CurrentPosition == 3)
                             LayOut[CurrentPosition].setVisible(false);
                             CurrentPosition += 3;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                             score += 1;
                        else if (CurrentPosition == 4)
                             AskQuestionBasic ask=new AskQuestionBasic("Joshua is working part time at a department store. His friend Jim,is also working there. One day, Jim was scolded by the manager(who is known to be unreasonable and bad-tempered),as he is being accused of theft. As 1 product from his shelf is missing. And you remembered sawing it at the other shelf in one of the department. What should he do?", 2, "Walk up to them and tell the manager the truth even though you know he might not like it and sacked both of you.", "Get someone who is on good terms with the manager to speak up for Jim, this way, both of them can retain their jobs.", "Better not get involved.", "Walk up to the manager and apologise, lying that you had taken the product without informing Jim.","SAD.GIF");
                        else if (CurrentPosition == 5)
                             AskQuestionBasic ask=new AskQuestionBasic("Sarah's group members are finishing their project parts. She's the only person in the group who has not even done anything at all.Her groupmates offered to help her and she let them do all her work.On the day of the presentation, she got high marks for her part, infact, higher than the others. She's feeling guilty at that time.Should she", 1, " Admit to the markers that she isn't the one who had done her part, but helped by her group members.", "Just get those marks and get out of here.", "Get the marks and later see if her group members mind. If yes,apologise to them and swear she will work harder and not commit the same mistakes again.", "Admit to the markers by telling them the truth.","BOOKS.GIF");
                        else if (CurrentPosition == 6)
                             score += 1;
                             //Credit -= 1;
                        else if (CurrentPosition == 7)
                             score += 10;
                             //Credit -= 10;
                        else if (CurrentPosition == 8)
                             AskQuestionBasic ask=new AskQuestionBasic("Randy had been using people's project and pass it off as his own.For the latest project, Randy had once again lie to his friend that he need a reference to do his project, and soon after, he copied this friend's work and pass it off as his own. Clifton had notice this and was not happy about this. What should he do?", 2, "Inform that friend about this before the teacher sees it.", "Have a talk with Randy.", "Inform the teacher. (The teacher always give students a chance to realise their mistakes)", "Do nothing since the project was not copied from him.","BOOK1.GIF");
                        else if (CurrentPosition == 9)
                             score -= 4;
                             //Credit += 4;
                        else if (CurrentPosition == 10)
                             AskQuestionBasic ask=new AskQuestionBasic("You realise that your classmate Jane has been stealing things from shops. What do you do?", 3, "Tell your teacher", "Report to the police", "Talk to her and ask her to change", "Tell her mother immdeiately","SAD.GIF");
                        else if (CurrentPosition == 11)
                             AskQuestionBasic ask=new AskQuestionBasic("Your sister seems to be very troubled these few days. She ignore everyone in the family and get frustrated easily. What do you do when you encounter this situation?", 3, " Quarrel with her", "Ignore her, after all it's none of your busniness", "Talk to her nicely and ask her about her problems", "Irritate her","SAD.GIF");
                        else if (CurrentPosition == 12)
                             score -= 3;
                             //Credit += 3;
                        else if (CurrentPosition == 13)
                             AskQuestionBasic ask=new AskQuestionBasic("You are on your way back home when you witness a teenager snatching away the purse of an old lady before pushing the old lady on the floor. What do you do at this instant?", 3, "Give chase of the robber", "Pretend you saw nothing", "Help the old lady up, and report the features of the robber to the police station ", "Curse and swear","SAD.GIF");
                        else if (CurrentPosition == 14)
                             score -= 5;
                             //Credit += 5;
                        else if (CurrentPosition == 15)
                             AskQuestionBasic ask=new AskQuestionBasic("You are standing in a crowded bus. You see an old man struggling to stand still on the bus. The person sitting on the seat which is meant for the needy refuses to give up the seat to the old man. What do you do at this moment?", 4, "Let the old man carry on standing", "Scold the person sitting down with vulgar words", "Keep staring at the man until he stands up", "Tell the person sitting down nicely to give up the seat to the old man","BUS2.GIF");
                        else if (CurrentPosition == 16)
                             score -= 2;
                             //Credit += 2;
                        else if (CurrentPosition == 17)
                             AskQuestionBasic ask=new AskQuestionBasic("Carol is a very quiet girl and she is very afraid of speaking up because she thinks that she will hurt people. So her friends tend to think that she is being too anti-social and reserved type. As a friend, what will you do to help her bcome more social?", 4, "Encourage her to join debating clubs", "Call her every nite and tok to her", "Just ignore", "Talk to her often and get to know her better to let her feel that she is still sociable","SAD.GIF");
                        else if (CurrentPosition == 18)
                             AskQuestionBasic ask=new AskQuestionBasic("Someone with a gang approach ur friend when she is alone. They offer a cigratte to her n force her to smoke. at that moment she is so panick that she does not know what to do. You happen to walk by and saw it. what will u do?", 3, "Just ignore as its none of your business.", "Go towards them and encourage her to smoke.", "Shout for help.", "Go towards them in your own risk, not knowing what will happen to you either.","SAD.GIF");
                        else if (CurrentPosition == 19)
                             score += 8;
                             //Credit -= 8;
                        labelScore.setText("" + score);
                        //labelCredit.setText("" + Credit);
                        if (num == 1)
                             DiePic = DiePic1;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        else if (num == 2)
                             DiePic = DiePic2;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        else if (num == 3)
                             DiePic = DiePic3;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        else if (num == 4)
                             DiePic = DiePic4;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        else if (num == 5)
                             DiePic = DiePic5;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        else if (num == 6)
                             DiePic = DiePic6;
                             LayOut[CurrentPosition].setIcon(picture);
                             LayOut[CurrentPosition].setVisible(true);
                        DieCon.setIcon(DiePic);
                   if (score >= 15)
                        JFrame frame = new JFrame("Moral Game");
                        frame.setContentPane(new win());
                        frame.setSize(729, 538);
                        //frame.setResizable(false);
                        frame.setLocation(150, 80);
                        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        frame.setVisible(true);

    i think im wrong.. nevermind then..There are a lot of experts here, most of them just
    ignore vague questions with pages of code, stated as
    an emergency, especially when the code is not formated
    using code tags.
    The fact that you expect an answer within 10 minutes
    of your original post is ridiculous on any day, but
    even more so on a Friday afternoon and even more so on
    a holiday.
    Actually..I am wondering where "pinkpawn.jpg" relates to the AskQuestion (paraphrased) "Encourage her to continue smoking"...
    But I'm not curious enough to hurt my already damaged eyesight further...

  • Flash Game Ground HELP!

    Hello all, I just started with flash and I'm pretty new to the language.
    I am currently making a game in flash and have a sprite that needs to jump up to platforms.
    He stands on the first rectangle I made but doesn't land on the others and passes right through them.
    I have changed the character code many times to no avail. I have tried other ways but he falls through the main ground platform when I change.
    Here's the code on my character, there is no code on the platforms. (I have tried coding the platforms which don't help either)
    onClipEvent (load) {
    speed = 8;
    isJumping = false;
    jumpSpeed = 0;
    startY = _y;
    scale = _xscale;
    onClipEvent (enterFrame) {
    if (isJumping) {
    _y += jumpSpeed;
    jumpSpeed += .86;
    if (_y>=startY) {
    _y = startY;
    isJumping = false;
    speed = 8;
    } else {
    if (Key.isDown(Key.UP)) {
    isJumping = true;
    jumpSpeed = -15;
    speed = 8;
    if (Key.isDown(Key.LEFT)) {
    play();
    _x -= speed;
    _xscale = -scale;
    } else {
    if (Key.isDown(Key.RIGHT)) {
    play();
    _x += speed;
    _xscale = scale;
    } else {
    stop();
    If there is more info I can provide to help, I will.
    Thank you.

    to have a game with Gravity, Jumping, and Ground Detection, first you need to make sure you enable all of these.
    GRAVITY-
    Gravity sounds weird and tricky but its also very simple.
    Theres a simple layout of code to enable Gravity.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
    What that does is adds a consistent pull on the MC you place it into. Adding a Gravity like effect.
    JUMPING-
    Jumping is also very simple once you've done it once or twice, and as i seen in your code you have.
    I will add Jumping to the previous code now.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
         var maxJump:Number = -22
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
         if (Key.isDown(Key.UP)) {
         Grav = maxJump;
    The maxJump variable is the height of the jump and can be modified to your liking, REMEMBER to always have the number as a minus - since flashes y axis is backwards.
    GROUND DETECTION-
    This is something i did not see in your code, which i believe it your issue.
    Ground Detection is very simple but hard to figure out with out good know how of Flash.
    First, make your Ground convert it to a MC, name it whatever you like.
    Second, set the Instance Name of your Ground MC, to "Ground" (no brackets).
    Third make sure all of you level/games ground is within this MC or within another MC with "Ground" as the Instance Name.
    I will add the Ground Detection to the previous code now.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
         var maxJump:Number = -22
         var touchingGround:Boolean = false;
         var Ground:MovieClip = _root.ground;
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
         while (Ground.hitTest(_x, _y, true)) {
              _y -= Gravity;
              Grav = 0;
         if (Ground.hitTest(_x, _y+5, true)) {
              touchingGround = true;
         } else {
              touchingGround = false;
         if (Key.isDown(Key.UP) && touchingGround){
              Grav = maxJump;
    Take your time to learn this and study it and re-build it on your own, or just use it and add to it.
    Message was edited by: UltimateFlashxz

Maybe you are looking for

  • Photoshop CS4, Windows 7 - move and type tool bugs

    My company recently had me upgrade my Dell Lattitude E6400 laptop from Windows XP to Windows 7. It was a reimage, so I had to reinstall all my software. Previously, I never encountered any bugs with Photoshop (barring the one that doesn't allow you t

  • Upgrade from ERP 5.0 to ERP 6.0 EHP 4 SP5 - phase START_SHDI_FIRST

    operating system: iSeries V6R1 (this one is probably for Volker Güldenpfennig...a Happy New Year from Germany!) SID: AP4 instance number normal: 00 instance number shadow: 08 hostname: ap400c error in phase MAIN_SHADOW/START_SHDI_FIRST: shadow instan

  • Facebook notifications SETTINGS missing

    I am unable to check my notifications settings on the Facebook application. I log in and go to Account Settings --> Notifications, and the page is BLANK. I have tried seemingly everything: logging off, deleting the app, shutting down the phone, etc e

  • Is Mac MINI support WOL after shutdown completely

    In PC environment,when the computer completely shutdown but connecting the power ,the lan card still have signal so that we can use the magic packet wake up Is Mac MINI support WOL after shutdown completely?

  • Tax_code and vat_tax_id in R12

    Hi All, I am working in an Upgrade project and as we are aware the TAX tables with AR_ is now ZX_. Can someone please help me in giving an appropriate table replacement for AR_VAT_TAX_ALL_B? Below mentioned are the queries which need to be replaced a