[BNM] [OT] Offside rule explained for girls
David Wren
david.r.wren at gmail.com
Thu Mar 2 11:31:56 GMT 2006
Ok I was bored, is this close?
function check_onside(position_of_ball,attacker,last_defender) {
if (attacker > position_of_ball) { //if attacker is infront of the ball,
check they are on side
if (attacker <= last_defender) {
return true; //onside
else {
if (!is_player_active(attacker)) {
return true; //onside
}
return false; //offside
}
}
} else {
return true; //onside
}
}
function is_player_active(player) {
//work out if player is active or not
}
ball.onPlay = check_onside(x,y,z);
On 02/03/06, Barry Bloye <bbloye at gmail.com> wrote:
>
> The offside rule is fairly simple once you understand it - it's
> explaining it that's the hard part. If one were to write it in script,
> it would involve several nested if/elses... Maybe someone could write
> a Javascript version for the benefit of the list.
>
> Diagrams always help...
> http://news.bbc.co.uk/sport1/hi/football/4679881.stm
>
> On 02/03/06, Alex Studd wrote:
> > You're in a shoe shop, second in the queue for the till. Behind the shop
> > assistant on the till is a pair of shoes which you have seen and which
> you
> > must have.
> >
> > The shopper in front of you has seen them also and is eyeing them with
> > desire.
> >
> > Both of you have forgotten your purses.
> >
> > It would be totally rude to push in front of the first woman if you had
> no
> > money to pay for the shoes.
> >
> > The shop assistant remains at the till waiting.
> >
> > Your friend is trying on another pair of shoes at the back of the shop
> and
> > sees your dilemma.
> >
> > She prepares to throw her purse to you.
> >
> > If she does so, you can catch the purse, then walk round the other
> shopper
> > and buy the shoes.
> >
> > At a pinch she could throw the purse ahead of the other shopper and,
> *whilst
> > it is in flight* you could nip around the other shopper, catch the purse
> and
> > buy the shoes.
> >
> > Always remembering that until the purse has *actually been thrown* it
> would
> > be plain wrong to be forward of the other shopper.
> >
> >
> > There you go poppet
> >
> > Alex Studd
> > Moving-edge.net
> > 0845 345 5763
> >
> >
> > --
> >
> > BNM info/subscription/archives: http://www.brightonnewmedia.org/
> >
> > BNM archive search: http://www.roddis.org/bnm/search.php
> > BNM Del.icio.us tag: http://del.icio.us/tag/bnm/
> > BNM Flickr group: http://www.flickr.com/groups/bnm/
> >
> > BNM powered by http://www.screen-play.net/
> >
>
> --
>
> BNM info/subscription/archives: http://www.brightonnewmedia.org/
>
> BNM archive search: http://www.roddis.org/bnm/search.php
> BNM Del.icio.us tag: http://del.icio.us/tag/bnm/
> BNM Flickr group: http://www.flickr.com/groups/bnm/
>
> BNM powered by http://www.screen-play.net/
>
More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service