ID:156910
 
hi I'm looking for some Source code for a chess game to help illustrate some of the fundamental code for making a board game.

Joshua50187 wrote:
hi I'm looking for some Source code for a chess game to help illustrate some of the fundamental code for making a board game.

Oh you!
In response to EnigmaticGallivanter
EnigmaticGallivanter wrote:
Joshua50187 wrote:
hi I'm looking for some Source code for a chess game to help illustrate some of the fundamental code for making a board game.

Oh you!

i have read that and im pretty good its just that with this game there is some weird rules that are hard to illustrate through code or to translate into code (well DM source code) i have programmed it into c but im having problems adapting it into DM cause i dont know what i will have to program from scratch and what byond provides for me

i.e. how to make a new window pop up with the board on it without making a 1000 map layers and without having interfere with other peoples games
In response to Joshua50187
If you're good, you shouldn't need a chess source. [s]I totally believe that you have read the guide[/s], and that is all that matters, correct? But just in case...

http://byond.com/docs/guide
http://byond.com/articles/start
http://byond.com/developer
http://byond.com/docs/ref
http://www.byond.com/members/?command=search&type=resources
In response to Darkjohn66
well thanks, so if all of you are in the pointing mood can someone point me in the direction of how to find out how to associate two similar objects in a linear formation (i.e. on the square next to it) excluding diagonal as one group that combine there porperties (i.e. there circumstances of capture)
In response to Joshua50187
jeez it took me 2 years of revising and beta testing to get the c program to where it is today and i know about as much byond now as i did c when i started it. so any help will be greatly appreciated
In response to Joshua50187
I'm not entirely sure what you mean, but get_step() is a good place to start.

Using a statement like "var/obj/piece/P = locate() in get_step(A,EAST)" will set P to the piece to the East of A (or null if there is no such piece). 'course you'll have to check that said piece is the same color.

If each direction doesn't need its own special code, you can set up a list to loop through the 4 cardinal directions relatively easily:

obj/piece
var/team = 0
proc/getNearby()
var/list/nearby = list()
var/list/dirs = list(NORTH,SOUTH,EAST,WEST)
for(var/d in dirs)
var/obj/piece/P = locate() in get_step(src,d)
if(P && P.team==team) nearby+=P
return nearby
In response to DarkCampainger
Thank you i see how i need to do it