Author | Post | |||
unknown user |
I think it would be a cool idea to have little side games on tbs. Seeing as the current ranking data is rather static, and doesn't say too much. You need years to reach the three hundreds, unless you are really bad kind of brilliant, or a very good cheater.. It would be nice to know that even though you are ranked way below someone, you can still beat them in a game of chess I like an occasional game of chess. It's easy to implement. doesn't require a lot of resources even to store full replays of a match. Furthermore I'm not too good at chess, and I'm confident that at least a few people would like to "beat" me To get a satisfactory implementation, we could make it a community challenge/project. A really simple implementation would be a single php, driving an html page with a form. Just submitting the two scares between a piece needs to move. And applying some database backend to keep track of the games, and to print an easy ranking page which could be as simple as just printing out all the games played between who, and the winner. Fancier ones, could be java applets, flash magic, webservices, Brilliant AJAX stuff, ... There already is an "WebChess" open source chess thingy, but writing it ourselves would be much more fun? Although ... being lazy |
|||
07.10.2007 03:09:55 |
|
|||
moose |
Hey rhican, I'm also not good at playing chess but I like such projects. I have the opinion that a good programmed computer programm always beats humans. My father didn't believe me, so I'm programming some programms for some games. I already have hangman, which helps me sometimes for crypto challenges (150.000 german words in a database, needs most of the time only 3 guesses for a word) and tic tac toe (100% win or draw)) I can only script with php and sql, so here is my beginning: SQL-Tables: CREATE TABLE `progress` ( `move_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `game_id` INT NOT NULL , `from` VARCHAR( 3 ) NOT NULL , `to` VARCHAR( 2 ) NOT NULL ) ENGINE = MYISAM ; CREATE TABLE `games` ( `game_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `white_player_id` INT NOT NULL , `black_player_id` INT NOT NULL , `winner` VARCHAR( 255 ) NOT NULL ) ENGINE = MYISAM ; CREATE TABLE `user` ( `uid` int(11) NOT NULL default '0', `email` varchar(255) NOT NULL default '', `bs_uname` varchar(255) NOT NULL default '', `uname` varchar(255) NOT NULL default '', `upass` varchar(32) NOT NULL default '', PRIMARY KEY (`uid`) ) ENGINE=MyISAM // store pass-hash (md5) only Wiki-Notation I would use this notations Qg5 - e3 means "queen moves from the square g5 to the square e3 I think there are much more people here who know something about security, so they should say what the login-system should be like (store ip, sessionid ...) @Erik and all BS-Admins: May we use your design (css and js)? I could give the webspace, if its ready. figure names: pawn, rook, knight, bishop, queen, and king. function is_legal_move ($figure, $from, $to, $player){ $figure = substr($from, 0, 1); if($figure=='p'){$figure = 'pawn';} $from = substr($from, 1, 2); switch($figure){ case 'pawn': return check_pawn_move($from, $to, $player); case 'rook': return check_rook_move($from, $to, $player); case 'knight': return check_knight_move($from, $to, $player); case 'bishop': return check_bishop_move($from, $to, $player); case 'queen': return check_queen_move($from, $to, $player); case 'king': return check_king_move($from, $to, $player); } } function check_pawn_move($from, $to, $player){ $number_from = substr($from, -1, 1); $number_to = substr($to, -1, 1); if($player == 'white'){ if($number_from > $number_to){return FALSE;} } else { if($number_from < $number_to){return FALSE;} } $letter_from = substr($from, 0, 1); $letter_to = substr($to, 0, 1); switch($letter_from){ case 'a': if($letter_to != 'b'){return FALSE;} case 'b': if($letter_to != 'a' AND $letter_to != 'c'){return FALSE;} case 'c': if($letter_to != 'b' AND $letter_to != 'd'){return FALSE;} case 'd': if($letter_to != 'c' AND $letter_to != 'e'){return FALSE;} case 'e': if($letter_to != 'd' AND $letter_to != 'f'){return FALSE;} case 'f': if($letter_to != 'e' AND $letter_to != 'g'){return FALSE;} case 'g': if($letter_to != 'f' AND $letter_to != 'h'){return FALSE;} case 'h': if($letter_to != 'g'){return FALSE;} } return TRUE; } |
|||
Edited by moose on 22.10.2007 17:34:04 | ||||
07.10.2007 08:08:45 |
|
|||
sniperkid |
great idea rhican, i'd love to beat you at something . |
|||
Edited by sniperkid on 07.10.2007 14:51:38 | ||||
07.10.2007 14:51:16 |
|
|||
quangntenemy |
Maybe you should make an IRC chess bot and battle with my bbq |
|||
08.10.2007 01:34:50 |
|
|||
sniperkid |
how about a bot that answers your bot and spams the channel . |
|||
08.10.2007 02:20:50 |
|
|||
Erik |
Hi, I appreciate your idea a lot. A community project would bring together the community and in the end every user could play the game. One thing I would like to know is if it shall be a part of bright-shadows.net or a seperate project on its own. Anyway, I strongly encourage you all to get on this project! Tell me if I can help. Cu, Erik |
|||
17.10.2007 15:33:48 |
|
|||
moose |
Well, I would do the following: At first, I load it up at my webspace for developing and testing (Or another active user, who can upload the scripts very fast). We make communicate with this forum and everyone posts his code here. As soon as it works fine and seems to have no exploits, we should integrate it in Bright Shadows. I think, if its made by the TBS-Community, they should be able to use it (and if I change something on my webspace, the chess game isn't affected). Another advantage is that we can make a "chess-ranking" in TBS (perhaps a new chess smilie?), which was rhicans original idea. |
|||
17.10.2007 15:49:15 |
|
|||
unknown user |
I hope it can end up on bright shadows, seeing as a major part of this is how it integrates with the tbs users. you can play other places too .. wouldn't be too much insentive to use our stuff then |
|||
17.10.2007 16:58:03 |
|
|||
sniperkid |
Yea a nice ranking table for tbs users too (me above rhican ) lol. |
|||
17.10.2007 18:09:04 |
|
|||
unknown user |
btw, I would rather not take a leading role in this project, but you can count on me to do some coding/testing. I would probably be too controlling for it to be a community project in the end So if somebody could take ownership of this idea and motivate enough people to get this on the road that would be brilliant. |
|||
17.10.2007 22:10:26 |
|