PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Quarters
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Quarters

Réponse
 
LinkBack Outils de la discussion
Vieux 11/04/2008, 14h49   #1
tedd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Quarters

Hi gang:

Check out my new game:

http://webbytedd.com/quarters/

What do you think?

Cheers,

tedd

PS: I originally wrote the game for the Mac over eight years ago.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
  Réponse avec citation
Vieux 11/04/2008, 14h53   #2
Jay Blanchard
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: [PHP] Quarters

[snip]
Check out my new game:

http://webbytedd.com/quarters/

What do you think?
[/snip]

Cool...but why do quarters keep appearing in other piles?
  Réponse avec citation
Vieux 11/04/2008, 16h00   #3
Jim Lucas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Quarters

tedd wrote:
> Hi gang:
>
> Check out my new game:
>
> http://webbytedd.com/quarters/
>
> What do you think?
>
> Cheers,
>
> tedd
>
> PS: I originally wrote the game for the Mac over eight years ago.


I keep getting JS errors.

I get this when I select a coin, or coins, and click remove coins.

Line: 122
Char: 3
Error: 'countr' is undefined
Code: 0
URL: http://webbytedd.com/quarters/index.php


If I tell the computer to start first, I get a JS error that says this:

Line: 64
Char: 2
Error: 'document.getElementById(...)' is null or not an object
Code: 0
URL: http://webbytedd.com/quarters/index.php

Plus, it seems that it is randomly reloading the page and resetting the game.

I am using IE 6.0.0029.xxxx Pretty much up to date will all patches and
updates. No special add ons.

Got any suggestions?

--
Jim Lucas

"Some men are born to greatness, some achieve greatness,
and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

  Réponse avec citation
Vieux 11/04/2008, 16h28   #4
larry@portcommodore.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Quarters

On Apr 11, 6:49 am, t...@sperling.com (tedd) wrote:
> Hi gang:
>
> Check out my new game:
>
> http://webbytedd.com/quarters/
>
> What do you think?
>
> Cheers,
>
> tedd
>
> PS: I originally wrote the game for the Mac over eight years ago.
> --
> -------http://sperling.com http://ancientstones.com http://earthstones.com


Does not work on Firefox on Linux, but on Konquerer it plays fine.

Larry
  Réponse avec citation
Vieux 11/04/2008, 21h49   #5
tedd
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut [PHP] Quarters -- ERRORS --

Hi gang:

Sorry for the lame app, but the program worked for Safari (Mac and
Win). However, I did get it to work for FF and a couple of other
browsers (Mac and Win), see again:

http://webbytedd.com/quarters

But the critter is dead in the water for all versions of IE -- if --
I don't figure out a way around the following single statement.

document.getElementById(id).checked = true;

Granted it's javascript, but all that line does is to set a checkbox
variable (id) to 'on'. Surely, $M code can do that, right?

After reading a bunch, it seems that M$ has a better way to do things
(big surprise there, huh?) and thus does not use the
document.getElementById(id) thing that everyone else in the world
uses. Instead, they use something "better" and it's not documented
well as is typical.

Unfortunately, I have not been able to find a M$ work-a-round.

So, what I need is:

if (document.getElementById)
{
document.getElementById(id).checked = true;
}
else
{
<<<<< inset solution here. >>>>>>
}

All the code has to do is to set a simple checkbox to 'on' in IE.

Anyone have any ideas?

Cheers,

tedd

PS: I'm going to post this on a js list as well.

PPS: You have to wonder how much more technically advanced we would
be if we weren't always held back by the "what's in it for me"
shortsightedness of M$.


--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
  Réponse avec citation
Vieux 11/04/2008, 23h00   #6
Kirk.Johnson@zootweb.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Quarters -- ERRORS --

tedd <tedd.sperling@gmail.com> wrote on 04/11/2008 02:49:21 PM:

> But the critter is dead in the water for all versions of IE -- if --
> I don't figure out a way around the following single statement.
>
> document.getElementById(id).checked = true;
>
> After reading a bunch, it seems that M$ has a better way to do things
> (big surprise there, huh?) and thus does not use the
> document.getElementById(id) thing that everyone else in the world
> uses. Instead, they use something "better" and it's not documented
> well as is typical.
>
> So, what I need is:
>
> if (document.getElementById)
> {
> document.getElementById(id).checked = true;
> }
> else
> {
> <<<<< inset solution here. >>>>>>
> }


The Javascript code below, using either Method 1 or Method 2, works fine
in IE 7. Have you tried running it in Firefox with the error console open?
I am wondering if there isn't a minor syntax error somewhere.

Kirk

<html><head><title></title>

<script type="text/javascript">
function checkme() {

// Method 1 - works fine in IE 7
// if(document.forms[0].test.checked) {
// document.forms[0].test.checked = false;
// }
// else {
// document.forms[0].test.checked = true; // }
// }

// Method 2 - works fine in IE 7
if(document.getElementById('test').checked) {
document.getElementById('test').checked = false;
} else {
document.getElementById('test').checked = true;
}
}
</script>
</head>
<body>

<form action="" method="post">
<input type="checkbox" name="test" id="test" onmouseover="checkme();">
Mouse Me
</form>

</body></head></html>
  Réponse avec citation
Vieux 11/04/2008, 23h33   #7
Daniel Kolbo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Return an Array and immediately reference an index

Hello,

I want to return an array from function and reference an index all in
one line. Is this possible?

In the code below I want I want $yo to be the array(5,6).

Here is what I've tried,

function returnarray() {
return array('lose' => array(5,6), 'win' => array(9,8));
}

$yo = returnarray()['lose'];
var_dump($yo);

This yields a parse error.


function returnarray() {
return array('lose' => array(5,6), 'win' => array(9,8));
}

$yo = {returnarray()}['lose'];
var_dump($yo);

This yields a parse error.

function returnarray() {
return array('lose' => array(5,6), 'win' => array(9,8));
}

$yo = ${returnarray()}['lose'];
var_dump($yo);

This gives notices as the result of returnarray() is being converted to
a string. $yo === NULL...not what i want.

function returnarray() {
return array('lose' => array(5,6), 'win' => array(9,8));
}

$yo = returnarray()->['lose'];
var_dump($yo);

This yields a parse error.

function returnarray() {
return array('lose' => array(5,6), 'win' => array(9,8));
}

$yo = ${returnarray()}->['lose'];
var_dump($yo);

This yields a parse error.

Thanks for your in advance.
  Réponse avec citation
Vieux 11/04/2008, 23h48   #8
Philip Thompson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Return an Array and immediately reference an index

Top-posting side comment: It's not nice to hijack threads.

My comments are below...

On Apr 11, 2008, at 5:33 PM, Daniel Kolbo wrote:
> Hello,
>
> I want to return an array from function and reference an index all
> in one line. Is this possible?
>
> In the code below I want I want $yo to be the array(5,6).
>
> Here is what I've tried,
>
> function returnarray() {
> return array('lose' => array(5,6), 'win' => array(9,8));
> }
>
> $yo = returnarray()['lose'];
> var_dump($yo);
>
> This yields a parse error.
>
>
> function returnarray() {
> return array('lose' => array(5,6), 'win' => array(9,8));
> }
>
> $yo = {returnarray()}['lose'];
> var_dump($yo);
>
> This yields a parse error.
>
> function returnarray() {
> return array('lose' => array(5,6), 'win' => array(9,8));
> }
>
> $yo = ${returnarray()}['lose'];
> var_dump($yo);
>
> This gives notices as the result of returnarray() is being converted
> to a string. $yo === NULL...not what i want.
>
> function returnarray() {
> return array('lose' => array(5,6), 'win' => array(9,8));
> }
>
> $yo = returnarray()->['lose'];
> var_dump($yo);
>
> This yields a parse error.
>
> function returnarray() {
> return array('lose' => array(5,6), 'win' => array(9,8));
> }
>
> $yo = ${returnarray()}->['lose'];
> var_dump($yo);
>
> This yields a parse error.
>
> Thanks for your in advance.



Perhaps these pages may assist you:

http://php.net/manual/en/function.array.php
http://php.net/functions

For more immediate , I think you want to do something along these
lines:

<?php
function returnArray ($index) {
$arr = array('lose'=>array(5,6), 'win'=>array(9,8));
return isset ($arr[$index]) ? $arr[$index] : 'Index not found';
}

$returnTheValueForThis = 'lose';
$result = returnArray ($returnTheValueForThis);
var_dump ($result);
?>

This var_dump will return:

array(2) { [0]=> int(5) [1]=> int(6) }

Hope that s. Do some more reading in the manual to yourself
out.

~Philip
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h50.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,06841 seconds with 16 queries