Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / help with random positioning

Author
Message
sspike dudley
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 30th Oct 2003 12:22
can anyone help me,
first of all i am making a chess game and i would like to know how if at all i can get a random piece say one from pieces 101-108 to move in a line a random number of spaces say 1 or 2 spaces is it possible i have made the player move there piece but i want the computer to move a random piece either one or two places
thanks for the help
sorry for the repeat just making myself clear
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Oct 2003 12:55
Randomize Timer()
piece = Rnd(8) + 100
move = Rnd(2)


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
sspike dudley
21
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 30th Oct 2003 13:19
that doesn't seem to work here is a bit of the code that moves the piece
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 30th Oct 2003 20:43
Well Jess, the "move" variable should be 1+rnd(1), so that 0 is not returned.

sspikedudley, your code snippet is a little bit confusing. Is the object number for the "cursor object" number 1? Is the black pawn object number 101 or 105? I am willing to help out, but need more information...

Xander - Bolt Software

Why do the antagonists always have to look so cool?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Oct 2003 05:20
Quote: "Well Jess, the "move" variable should be 1+rnd(1), so that 0 is not returned."


Yeah, sorry, i neglected that... thanks...

I also can;t properly understand the snippet...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-21 09:50:54
Your offset time is: 2025-05-21 09:50:54