Hangman Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hangman Help

    im trying to put hangman game in my chat. well im almoust done, but there is one problem.
    i dont no what i need to put in here <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>if ($cat==anmls){
    $category="ZIVALI";
    print "zivali";
    $list = "ANIMALS</div> to still be loged on chat??iff i click on back or index page im still loged. but when i click on any letter (A,B,C...), not loged any more. i hope 1 one understand what i mean.
    Attached Files

    #2
    I think here is your error(on 352 line):
    Code:
    else
        { $links .= " <a href=\"$self?cat=$cat&amp;letters=$alpha[$c]$letters&amp;n=$n\">$alpha[$c]</a> "; }
      }
    You should change it with
    Code:
    else
        { $links .= " <a href=\"$PHP_SELF?id=$id&amp;pass=$pass&amp;cat=$cat&amp;letters=$alpha[$c]$letters&amp;n=$n\">$alpha[$c]</a> "; }
      }

    Comment


      #3
      tnx mate....its works

      Comment


        #4
        tnx mate....its works [/b]
        NP

        Comment


          #5
          anybody have hangman or other game for funmobile??share wit me plz,,thanks all..

          Comment


            #6
            can somebody put a tutorial for this?

            Comment


              #7
              Code:
              else if($action == "hangman")
              {
                addonline(getuid_sid($sid),"Playing Hangman","");
                echo "<card id=\"main\" title=\"Hangman\">";
                if ($cat==""){
                echo "<p align=\"center\">
                <img src=\"../images/hang_6.gif\" alt=\"Hangman\"/>
              
                Select a category:
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=anmls&amp;sid=$sid\">Animals</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=clrs&amp;sid=$sid\">Colours</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=comp&amp;sid=$sid\">Computers</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=frt&amp;sid=$sid\">Fruit</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=big&amp;sid=$sid\">Big Words</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=lotr&amp;sid=$sid\">Lord Of The Rings</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=mths&amp;sid=$sid\">Months</a>
              ";
                echo "<a href=\"$PHP_SELF?action=hangman&amp;cat=web&amp;sid=$sid\">Web / Wap coding</a>
              ";
              
                echo "
              <a href=\"index.php?action=main&amp;sid=$sid\">Back</a>
              ";
              
                echo "</p></card></wml>";
                exit();
                }
              if ($cat==anmls){
              $category="ANIMALS";
              $list = "ANIMALS
              BABOON
              BEAR
              BULL
              CAMEL
              CAT
              COW
              CROW
              DOG
              DONKEY
              DUCKBILL PLATYPUS
              EAGLE
              ELEPHANT
              FISH
              FOX
              GIRAFFE
              GOAT
              GOLDFISH
              HAWK
              HEDGEHOG
              HORSE
              KANGAROO
              KITTEN
              MOLE
              MONKEY
              MOUSE
              MULE
              OWL
              PARROT
              PIG
              PINK ELEPHANT
              POLAR BEAR
              PORCUPINE
              POSSUM
              PUPPY
              RABBIT
              RACCOON
              RAT
              ROBIN
              SEAL
              SHARK
              SKUNK
              SQUIRREL
              STOAT
              WALRUS
              WEASEL
              WHALE
              ZEBRA";}
              
              
              
              if ($cat==clrs){
              $category="COLOURS";
              $list = "BLACK
              BLUE
              BROWN
              BUBBLEGUM PINK
              COLORS
              CYAN
              FUCHSIA
              GOLD
              GREEN
              GREY
              INDIGO
              LAVENDER
              LIME GREEN
              MAROON
              OLIVE
              ORANGE
              PERIWINKLE
              PINK
              PURPLE
              RED
              ROYAL BLUE
              SCARLET
              TEAL
              TURQUOISE
              VIOLET
              WHITE
              YELLOW"; }
              
              
              if ($cat==comp){
              $category="COMPUTERS";
              $list = "ACCESS
              ANTI-VIRUS SOFTWARE
              BASIC
              CD-ROM DRIVE
              CHAT
              COMPUTER
              CPU
              DATABASE
              DOS
              EMAIL
              EXCEL
              FIREWALL
              FLOPPY DRIVE
              FORUMS
              FRONTPAGE
              GAMES
              HACKER
              HARD DRIVE
              HTML
              ICQ
              INTERNET
              JUNK MAIL
              KEYBOARD
              LINUX
              LOTUS
              MICROSOFT
              MONITOR
              MOTHER BOARD
              MOUSEPAD
              OPERATING SYSTEM
              PARALLEL PORT
              PHP
              PRINTER
              PUBLISHING
              RAM
              SERIAL PORT
              SOLITARE
              SPEAKERS
              TECHNOLOGY
              UNIX
              URL
              VIRUS
              VISUAL BASIC
              WINDOWS
              WORD
              WORD PROCESSING
              WORLD WIDE WEB
              ZIP"; }
              
              
              if ($cat==frt){
              $category="FRUIT";
              $list = "APPLE
              BANANA
              BLACKBERRY
              BLUEBERRY
              FRUIT
              GRAPE
              GRAPEFRUIT
              KIWI
              MANGO
              ORANGE
              PEACH
              PEAR
              RASBERRY
              STRAWBERRY
              TANGERINE
              TOMATO
              UGLY FRUIT"; }
              
              
              
              if ($cat==big){
              $category="BIG WORDS";
              $list = "AUSTRALOPITHECINE
              DEOXYRIBONUCLEIC ACID
              LARGE WORDS
              MITOCHONDRIA"; }
              
              if ($cat==lotr){
              $category="LORD OF THE RINGS";
              $list = "AGORNATH
              ARAGORN
              ARWEN
              BAG END
              BALIN
              BALROG
              BARROW DOWNS
              BARROW WRIGHT
              BEREN
              BILBO BAGGINS
              BLACK RIDERS
              BOROMIR
              BREE
              BUCKLAND
              CELEBORN
              DEAD MARSHES
              DWARVES
              EDORAS
              ELENDIL
              ELFSTONE
              ELROND
              ELVES
              ENTS
              EOWYN
              FANGORN FOREST
              FARAMIR
              FRODO BAGGINS
              GALADRIEL
              GANDALF
              GILGALAD
              GLAMDRING
              GLORFINDEL
              GOLDBERRY
              GOLLUM
              GONDOR
              HALDIR
              HELMS DEEP
              HOBBITON
              HOBBITS
              ISENGARD
              ISILDUR
              LEGOLAS
              LEMBAS BREAD
              LONELY MOUNTAIN
              LONELY MOUNTIAN
              LORD OF THE RINGS
              LOTHLORIEN
              LUTHIEN
              MELKOR
              MEN
              MERRY
              MIDDLE EARTH
              MINAS MORGUL
              MINAS TIRITH
              MIRKWOOD
              MITHRANDIR
              MITHRIL
              MORDOR
              MORIA
              MT. DOOM
              MY PRECIOUSSS
              NAZGUL
              NUMENOR
              OLD FOREST
              OLD MAN WILLOW
              ORCS
              ORTHANC
              PIPE WEED
              PIPPIN
              PLAINTIR
              RANGERS
              RINGWRAITHS
              RIVENDELL
              ROHAN
              SAMWISE GAMGEE
              SARUMAN
              SAURON
              SHADOWFAX
              SHAGRAT
              SHELOB
              SHIRE
              SILMARILLIAN
              SMAUG
              SMEAGOL
              STEWARD OF GONDOR
              STING
              STRIDER
              THE FELLOWSHIP OF THE RING
              THE RETURN OF THE KING
              THE RING
              THE TWO TOWERS
              THEODIN
              TOM BOMBADIL
              TREEBEARD
              TROLLS
              UNDYING LANDS
              URUK-HAI
              VALINOR
              WARG RIDERS
              WEATHERTOP
              WIZARDS
              WORMTONGUE";}
              
              
              if ($cat==mths){
              $category="MONTHS";
              $list = "APRIL
              AUGUST
              DECEMBER
              FEBRUARY
              JANUARY
              JULY
              JUNE
              MARCH
              MAY
              MONTHS
              NOVEMBER
              OCTOBER
              SEPTEMBER"; }
              
              if ($cat==web){
              $category="WEB / WAP CODING";
              $list = "JAVA BEANS
              PHP SCRIPTS
              SOURCE CODE
              JAVASCRIPT GAMES
              SSI IS SERVER SIDE INCLUDES
              BILL GATES
              COOKIES
              HTTP AUTHENTICATION
              ERROR HANDLING
              MANIPULATING IMAGES
              FILE UPLOADS
              DATABASE / CONNECTION
              APACHE SERVER
              ZIP FILE
              TAR COMPRESSION
              FUNCTIONS
              ENCRYPTION
              MYSQL DATABASE
              INITIALIZATION
              FAQ - FREQUENTLY ASKED QUESTIONS
              DEBUGGING
              VERIFICATION
              HTML VALIDATION
              CASCADING STYLE SHEETS";}
              
              # below ($alpha) is the alphabet letters to guess from.
              #   you can add international (non-English) letters, in any order, such as in:
              #   $alpha = "????????????????????????????ABCDEFGHIJKLMNOPQRSTUVWXYZ";
              $alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
              
              # below ($additional_letters) are extra characters given in words; &#39;?&#39; does not work
              #   these characters are automatically filled in if in the word/phrase to guess
              $additional_letters = " -.,;!?%& 0123456789/";
              
              #========= do not edit below here ======================================================
              
              $sid = $_GET["sid"];
              $uid = getuid_sid($sid);
              $len_alpha = strlen($alpha);
              
              if(isset($_GET["n"])) $n=$_GET["n"];
              if(isset($_GET["letters"])) $letters=$_GET["letters"];
              if(!isset($letters)) $letters="";
              
              if(isset($PHP_SELF)) $self=$PHP_SELF;
              else $self=$_SERVER["PHP_SELF"];
              
              $links="";
              $max=6;
              # error_reporting(0);
              $list = strtoupper($list);
              $words = explode("\n",$list);
              srand ((double)microtime()*1000000);
              $all_letters=$letters.$additional_letters;
              $wrong = 0;
              
              echo "<p align=\"center\">";
              if (!isset($n)) { $n = rand(1,count($words)) - 1; }
              $word_line="";
              $word = trim($words[$n]);
              $done = 1;
              for ($x=0; $x < strlen($word); $x++)
              {
                if (strstr($all_letters, $word[$x]))
                {
                  if ($word[$x]==" ") $word_line.=" / "; else $word_line.=$word[$x];
                }
                else { $word_line.="_ "; $done = 0; }
              }
              
              if (!$done)
              {
              
                for ($c=0; $c<$len_alpha; $c++)
                {
                  if (strstr($letters, $alpha[$c]))
                  {
                    if (strstr($words[$n], $alpha[$c])) {$links .= "[b]$alpha[$c][/b] "; }
                    else { $links .= " $alpha[$c] "; $wrong++; }
                  }
                  else
                  { $links .= " <a href=\"$self?action=hangman&amp;cat=$cat&amp;letters=$alpha[$c]$letters&amp;n=$n&amp;sid=$sid\">$alpha[$c]</a> "; }
                }
                $nwrong=$wrong; if ($nwrong>6) $nwrong=6;
                echo "
              <img src=\"../images/hang_$nwrong.gif\" alt=\"Wrong: $wrong out of $max\"/>
              ";
              
                if ($wrong >= $max)
                {
                  $n++;
                  if ($n>(count($words)-1)) $n=0;
                  echo "
              
              $word_line";
                  echo "
              
              <big>SORRY, YOU ARE HANGED!!!</big>
              
              ";
                  if (strstr($word, " ")) $term="answer"; else $term="word";
                  echo "The $term was \"[b]$word[/b]\"
              
              ";
                  $sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id=&#39;".$uid."&#39;");
                  $sqlfet=mysql_fetch_array($sqlfetch);
                  $gplusnew=$sqlfet[0] - "25";
                  $sql="UPDATE ibwf_users SET gplus=&#39;".$gplusnew."&#39; WHERE id=&#39;".$uid."&#39;";
                  $res=mysql_query($sql);
                  echo "You Have Had 25 game Plusses Deducted For Losing.
              ";
                  echo "<a href=\"$self?action=hangman&amp;cat=$cat&amp;n=$n&amp;sid=$sid\">Play again</a>
              ";
                echo "<a href=\"$self?action=hangman&amp;sid=$sid\">Change category</a>";
                }else{
                  echo " Wrong Guesses Left: [b]".($max-$wrong)."[/b]
              
              ";
                  echo "$word_line";
                  echo "
              
              Choose a letter:
              ";
                  echo "$links";
                }
              }else{
                $n++;    # get next word
                if ($n>(count($words)-1)) $n=0;
                echo "
              
              \n$word_line";
                echo "
              
              [b]Congratulations!!! You win!!![/b]
              
              
              ";
                    $sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id=&#39;".$uid."&#39;");
                  $sqlfet=mysql_fetch_array($sqlfetch);
                  $gplusnew=$sqlfet[0] + "25";
                  $sql="UPDATE ibwf_users SET gplus=&#39;".$gplusnew."&#39; WHERE id=&#39;".$uid."&#39;";
                  $res=mysql_query($sql);
                  echo "You Have Had 25 game Plusses Added For Winning.
              ";
                echo "<a href=\"$self?action=hangman&amp;cat=$cat&amp;n=$n&amp;sid=$sid\">Play again</a>
              ";
                echo "<a href=\"$self?action=hangman&amp;sid=$sid\">Change category</a>";
              }
                echo "
              
              <a href=\"index.php?action=main&amp;sid=$sid\">Back</a>";
                echo "</p></card>";
              }
              but its not coded by me

              Comment


                #8
                where to put that?

                Comment


                  #9
                  it aint working. when i choose a cat it only refresh the page

                  WapCHAT Forum Currenltly changing over to xhtml

                  My Dowloads Site

                  Comment


                    #10
                    Try

                    $cat = $_GET[&#39;cat&#39;];

                    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                    Visit: WapMasterz Coming Back Soon!
                    _______
                    SCRIPTS FOR SALE BY SUBZERO
                    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                    _______
                    Info & Tips
                    php.net
                    w3schools.com

                    Comment

                    Working...
                    X