ID:271426
 
I can't setup a double-jump rule for an English Draughts game I'm making, everything I try seems to be unusually slow and un-effective! =( Supposedly, my problem is that I'm hack*-looping through many unnecessary pieces...

Perhaps anyone can help me here? Including psuedo/DM-code would be nice =)

* Hacky solutions, that is. Many additional 'variations' of the same procedure to act with the current situation...
... I doubt anyone has ANY idea what you're talking about.
In response to Foomer
Checkers? How do I make a procedure that shows me how far I can double-jump a piece after a piece? And where?
In response to DivineO'peanut
Checkers? How do I make a procedure that shows me how far I can double-jump a piece after a piece? And where?

Checkers don't exactly have many options in which they can move. It shouldn't be slow unless you're doing something weird. But no one will be able to help you if they don't understand how you're trying to handle the problem or at least how you have things set up so a solution can be proposed.
In response to Theodis
Whoops! Didn't notice your reply, sorry for the late post. Anyway, since I asked for pseudoanswercode, I didn't think it was necessary. But, on second thought, you're right...

The system isn't really something, it's just objs n' turfs...

To see if a piece can jump another(assuming it isn't a king, haven't included those yet),
        _CanJump(obj/piece/p)
if((istype(src,BLACKPIECE) && istype(p,WHITEPIECE)) || (istype(src,WHITEPIECE) && istype(p,BLACKPIECE)))
var/d1 = (dir | EAST)
var/d2 = (dir | WEST)
var/d
if(get_dir(src,p) == d1) d = d1
else if(get_dir(src,p) == d2) d = d2
else if(!d) return 0
var/turf/t = get_step(p,d)
if(t.Enter(p)) return t


Turf code:
turf
Enter()
return 0

board
icon = 'tiles.dmi'

black
icon_state = "black"

Enter(obj/piece/O)
if(!istype(O,PIECE)) return 0
if(contents.len >= 1) return 0
return (get_dist(src,O) == 1)


Then, to see if I can multi-jump, I check every piece nearby the piece I'm trying to jump on... which I think is the problem. I can supply that code, too, but then I'd have to supply the whole source with it...

Thanks in advance!
BUMP