| Author |
Message |
| groza528 |
Posted: Fri Feb 17, 2006 3:13 pm Post subject: 1 |
|
| CrystyB wrote: |
(and change the starting colour of the next line - WTH ) |
That one's pretty easy to explain. The chess tags are set up so that every row begins with the same colour the last row ended with. MAking an odd number of squares in a row would mean the next row would match the one above it. |
|
 |
| Antrax |
Posted: Fri Feb 17, 2006 1:49 pm Post subject: 0 |
|
| This is not a bug. Erroneous input causes an ill-defined behaviour, this is how things work. You might as well complain that it doesn't parse illegal moves. |
|
 |
| CrystyB |
Posted: Fri Feb 17, 2006 10:20 am Post subject: -1 |
|
I don't know if this is just a glitch or a full bug, but the "chessboard" tags handle white spaces a little inconsistently: spaces break the whole thing, tabs insert a blank square (and change the starting colour of the next line - WTH ), and carriage returns insert two blank squares (i chance on guessing that this is equivalent to two tabs! )... |
|
 |
| jeep |
Posted: Tue Feb 08, 2005 7:05 am Post subject: -2 |
|
Carriage returned has to be handled specially. I don't. I suppose I could look into it.
-JEEP |
|
 |
| CrystyB |
Posted: Mon Feb 07, 2005 8:44 pm Post subject: -3 |
|
| Not really a bug (since i think i remember you mentioning about it), but why aren't we allowed to use CRs inside the aliases? See reply 86: "-1: In move number: 1, c3=b1{c3 [lower <CR>left]...} is not valid and has been skipped". |
|
 |
| CrystyB |
Posted: Sun Feb 06, 2005 9:15 am Post subject: -4 |
|
Testing...
Hmm, yes it still lets illegal moves through... (chess]g4 g6 e3 f5 g5 Bg7 a4 Bf6 gxf6 b5 b3 b4 d4 d6 f7 Kd7 f8=N Kc6 Ne6 g4 Nc5 dxc5[/chess]
Note: 10 ... g4==trouble!!!
Even (chess]e5 e4[/chess] would be posted as is...
[update]So basically just because the GL lacks that PEAR the chess players will have to watch their moves. They'll have to look at the board to catch illegal moves. (i'm okay with it, it's just that i want to have this mentioned somewhere. Now it is ) |
|
 |
| jeep |
Posted: Sun Feb 06, 2005 1:47 am Post subject: -5 |
|
That last was interesting because it was handled correctly on mafiascum (with the exact same code.) It's because that server has PEAR. But good coding style would have avoided that. I believe all invalid moves are now caught EXCEPT it might let you move while in check. Without PEAR, I need to rewrite that code.
-JEEP |
|
 |
| jeep |
Posted: Sun Feb 06, 2005 1:45 am Post subject: -6 |
|
        
        
        
        
        
        
        
        
        
| f8-f8+Nf8 is not a valid move. Any moves after that are ignored.
1. g4 g6 2. e3 f5 3. g5 Bg7 4. a4 Bf6 5. gxf6 b5 6. b3 b4 7. d4 d6 8. f7 Kd7
|
|
|
 |
| jeep |
Posted: Sat Feb 05, 2005 11:11 pm Post subject: -7 |
|
So the bug is that the second board is reveresed? *sigh* I'll fix that. If you want to rotate the board, you'll have to use chessvariant tags, but that feature doesn't work as well as I'd like.
EDIT: I ported this from a stand alone app... I made the square color static...
-JEEP |
|
 |
| CrystyB |
Posted: Sat Feb 05, 2005 3:29 pm Post subject: -8 |
|
fooling around with making the Chess tag promote one of my pawns, i tried f8-f8+Nf8 (since f8N was not valid -- i now understand it's supposed to be f8=N, but still, you might want to 'catch' this). This resulted in a total mess, with these messages output on the page:
| Quote: |
Warning: Variable passed to each() is not an array or object in /usr/www/users/wx3qs/greylab/discussion/includes/Chess.php on line 1151
Warning: Variable passed to each() is not an array or object in /usr/www/users/wx3qs/greylab/discussion/includes/Chess.php on line 404
Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/wx3qs/greylab/discussion/includes/Chess.php:1151) in /usr/www/users/wx3qs/greylab/discussion/includes/page_header.php on line 475
Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/wx3qs/greylab/discussion/includes/Chess.php:1151) in /usr/www/users/wx3qs/greylab/discussion/includes/page_header.php on line 477
Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/wx3qs/greylab/discussion/includes/Chess.php:1151) in /usr/www/users/wx3qs/greylab/discussion/includes/page_header.php on line 478 |
fwiw, i was trying this succession: (chess]g4 g6 e3 f5 g5 Bg7 a4 Bf6 gxf6 b5 b3 b4 d4 d6 f7 Kd7 f8-f8+Nf8 Kc6 Ne6 g4 Nc5 dxc5 [/chess]
And another messup on my part: i made the illegal move (g6-)g4, but as i understand things your code should've rejected it. Instead, it blew up the board from the fourth line downwards. |
|
 |
| CrystyB |
Posted: Sat Feb 05, 2005 10:49 am Post subject: -9 |
|
What's with this?? As i_h8_evil_stuff posted, it's sideways... How come??
[edit]But please don't remove that possibility. It would make for some interesting chess puzzles for the novices. [/edit]
[edit]Strangely, when replying to the thread, the board in the Review Topic iframe looks just like it's supposed to!!
And it's not just that one post. The board in the first post in that thread is affected too.
[update]Each second chessboard tag is switching colour placements. That's why in the Review Topic iframe, the board in the first post was affected. |
|
 |
| jeep |
Posted: Fri Feb 04, 2005 8:16 am Post subject: -10 |
|
Huh, haven't touched that code in a while... so what's buggy other than the titles not showing?
-JEEP
EDIT: Found it. Let me know about anything else. |
|
 |
| Lucky Wizard |
Posted: Fri Feb 04, 2005 6:39 am Post subject: -11 |
|
| See the GLN thread... the PGN tags seem buggy, as the PGN notation no longer shows up in (for example) the PGN example in the GLN thread. |
|
 |
| jeep |
Posted: Thu Feb 03, 2005 11:20 am Post subject: -12 |
|
I'm annoyed at myself... the solution was relatively simple, once I changed my way of thinking:
Instead of splitting, match and then it's just;
| Code: |
| preg_match_all("/[^\s,{]+({[^}]*})?/", $text, $matching, PREG_PATTERN_ORDER); |
I'm going to put the new code in place, but I probably shouldn't. I tested the parts I changed, but nothing else. Let me konw if you find new bugs.
Moves are seperated by spaces or commas, but within braces, only a close-brace is not allowed. I editted reply 86 just to make sure it works.
-JEEP |
|
 |
| jeep |
Posted: Thu Feb 03, 2005 10:28 am Post subject: -13 |
|
OK so here is how I'm thinking the regexp might work:
invert the set of \S (non-white space) and {.*} and that's what I want. Now I just need to figure it out:
#[^\S({.*})]# didn't work, but I didn't really expect it to.
-JEEP |
|
 |
| jeep |
Posted: Wed Feb 02, 2005 11:26 pm Post subject: -14 |
|
Heh, today it's: #[\s,]+#
that is: preg_split ('#[\s,]+#', $text)
(or something very close...) I split it based on spaces or commas, THEN I break up each move into it's parts... (one of which is #{(.*)}#, to which I backreference to get the alias.)
-JEEP |
|
 |
| Vinny |
Posted: Wed Feb 02, 2005 11:18 pm Post subject: -15 |
|
lol.
true. I just looked to my eyes better that way
I guess I should wait for jeep to show us the regexp he's using currently (if he does) before making further suggestion. |
|
 |
| CrystyB |
Posted: Wed Feb 02, 2005 8:11 pm Post subject: -16 |
|
mg: oops, you do have a point, but it's not entirely correct. The board in Y is a triangle, which cannot be made similar to the Hex's rhombus.
Vin: i don't see how that (stick quotes around it, inside curly brackets) is any different better than the current (stick curly brackets around it)... |
|
 |
| Vinny |
Posted: Wed Feb 02, 2005 7:11 pm Post subject: -17 |
|
| Quote: |
Vin, the parsing-for-moves RegExp uses all the spaces it finds, i strongly suspect. (i don't know yet where does the comma come from.) The thing is: how to ignore spaces within curly brackets...
|
Hmmm, I see. I guess jeep can always force " inside curly brackets for alias.
e.g. {"some alias lalala"}
That would make your life much easier jeep. |
|
 |
| mathgrant |
Posted: Wed Feb 02, 2005 6:31 pm Post subject: -18 |
|
| CrystyB wrote: |
| mathgrant wrote: |
| Looks like no one will be playing Y any time soon. |
Umm... Y isn't played like Chess or Hex (i.e., inside the figures), but like Go (in the dots of intersections)... Also, the figures aren't hexagons, they're triangles. See [url=http://en.wikipedia.org/wiki/Y_(game)]here[/url]. |
Um. . . they're equivalent games, Crysty.    |
|
 |
| CrystyB |
Posted: Wed Feb 02, 2005 5:08 pm Post subject: -19 |
|
Vin, the parsing-for-moves RegExp uses all the spaces it finds, i strongly suspect. (i don't know yet where does the comma come from.) The thing is: how to ignore spaces within curly brackets...
Ow, and thanks for the RegExp 101, but i guess i could get that from a manpage somewhere. I think i once or twice already looked at it, but it didn't stuck. It's just too much stuff to sink my teeth in at once. I'd rather just use "*" and "?", or do it myself. I know there aren't many (if any) arguments for what i'm saying, but i'm too lazy to study REs. |
|
 |
| Vinny |
Posted: Wed Feb 02, 2005 4:55 pm Post subject: -20 |
|
for Crysty, if you want to learn regexp pattern, here's a quick starting guide.
* Matches the previous character zero or more times
+ Matches the previous character one or more times
? Matches the previous character zero or one times
. Matches any single character except the newline
^ Matches the start of the input
$ Matches the end of the input
x|y Matches either first or second character listed
(pattern) Matches pattern
{number} Matches exactly number times
{number,} Matches number, or more, times (note comma)
{num1, num2} Matches at least num1 and at most num2 times
[abc] Matches any character listed between the [ ]
[^abc] Matches all characters except those listed between the [ ]
[a-e] Matches any characters in the specified range (a,b,c,d,e)
[^K-Q] Matches all characters except in the specified range
\ Signifies that the next character is special or a literal.
\b Matches only on a word boundary
\B Matches only inside a word
\d Matches only on a digit
\D Matches only on a non-digit
\f Matches only on a form feed character
\n Matches only on a new line
\r Matches only on a carriage return
\s Matches only on a blank space
\S Matches only on nonblank spaces
\t Matches only on a tab
\v Matches only on a vertical tab
\w Matches only on A to Z, a to z, 0 to 9, and _
\W Matches characters other than A to Z, a to z, 0 to 9, and _
\number Matches any positive number
\octal Matches any octal number
\xhex Matches any hexadecimal number (x is required)
It's really fun to mess with!
Actually jeep, I am guessing that you have code to split each move already. Can't you just apply the simple \{.*\} regexp to each move entry afterwards for parsing out the alias text? |
|
 |
| Vinny |
Posted: Wed Feb 02, 2005 4:52 pm Post subject: -21 |
|
| wordstuckintheboxcross wrote: |
Okay, seriously. I don't understand why that's not check. Someone care to explain this?
|
Wordcross ... the reason was cleared up after Jeep added the Black and White starting position on the board.White move up, OK???
ah that's right jeep, it's the entire string, not per move. now if you force the move each black/white move string to be delimited by a return carriage ...
lol.
PM me the regexp you have so far so I can work on it too! |
|
 |
| CrystyB |
Posted: Wed Feb 02, 2005 9:09 am Post subject: -22 |
|
| mathgrant wrote: |
| Looks like no one will be playing Y any time soon. |
Umm... Y isn't played like Chess or Hex (i.e., inside the figures), but like Go (in the dots of intersections)... Also, the figures aren't hexagons, they're triangles. See [url=http://en.wikipedia.org/wiki/Y_(game)]here[/url].
But thanks for the idea. I'm tempted to start looking at Y too, if i can find a program wired to beat me every single time (all the Hex programs i found had such an easy time doing it...).  |
|
 |
| jeep |
Posted: Wed Feb 02, 2005 8:56 am Post subject: -23 |
|
Game tags have been updated to handle the couple bugs we found and to add the capability to add titles to chessvariants and go.
-JEEP |
|
 |
| jeep |
Posted: Wed Feb 02, 2005 6:48 am Post subject: -24 |
|
Well, that's not really what I need Vinny.
I need to figure out how to get all the moves separated... the string will look like:
| Code: |
| move{free text} nextMove{more free text} anotherMove anotherMove2{free text} etc |
I'm using preg_split and need to get the regexp such that It splits the moves (with free text in braces).
-JEEP |
|
 |
| mathgrant |
Posted: Wed Feb 02, 2005 5:48 am Post subject: -25 |
|
| Considering how you play Chess4 all the time, I'm surprised you never considered the possibility that WHITE could be moving his pawns UP. The H2 pawn has never moved. :-p |
|
 |
| wordcross |
Posted: Wed Feb 02, 2005 4:44 am Post subject: -26 |
|
| Samadhi wrote: |
| wordcross wrote: |
| ... i can see that white to move would make it non-stalemate. but if it were black to move... where could he go? |
G1? |
Okay, seriously. I don't understand why that's not check. Someone care to explain this? |
|
 |
| mathgrant |
Posted: Wed Feb 02, 2005 1:57 am Post subject: -27 |
|
| a | | b | | c | | d | | e | | f | | | |  |  |  |  |  |  |  |  |  |  |  |  | | 1 |  |  |  |  |  |  |  |  |  |  |  |  | 1 | |  |  |  |  |  |  |  |  |  |  |  | | 2 |  |  |  |  |  |  |  |  |  |  | 2 | | |  |  |  |  |  |  |  |  |  | | | 3 |  |  |  |  |  |  |  |  | 3 | | | |  |  |  |  |  |  |  | | | | 4 |  |  |  |  |  |  | 4 | | | | |  |  |  |  |  | | | | | 5 |  |  |  |  | 5 | | | | | |  |  |  | | | | | | 6 |  |  | 6 | | | | | | |  |  | | | | | | | | | a | | b | | c | | d | | e | | f | |
|
Looks like no one will be playing Y any time soon. |
|
 |
| CrystyB |
Posted: Wed Feb 02, 2005 1:13 am Post subject: -28 |
|
i never really started to use them, so i know almost nothing of RegExps...
But, Vin, i wonder what would your Exp give from "start{text1}middle{text2}end"? |
|
 |
| Vinny |
Posted: Wed Feb 02, 2005 1:09 am Post subject: -29 |
|
| jeep wrote: |
I thought about mentioning the spaces and comma thing, but I am thinking about how to remove that restriction. Since the alias is enclosed in braces, it shouldn't be too difficult, I just can't quite get the regular expression perfect.
-JEEP |
isn't it pretty simple Jeep?
you'll have to strip the left and right brackets tho afterwards. |
|
 |
| jeep |
Posted: Wed Feb 02, 2005 12:41 am Post subject: -30 |
|
Yeah, I fixed that, but haven't release it. I hoped no one would notice
-JEEP |
|
 |
| CrystyB |
Posted: Wed Feb 02, 2005 12:17 am Post subject: -31 |
|
Finally! A real coding fluke for a change...
| a | | b | | c | | d | | e | | f | | | |  |  |  |  |  |  |  |  |  |  |  |  | | 1 |  |  |  |  |  |  |  |  |  |  |  |  | 1 | |  |  |  |  |  |  |  |  |  |  |  |  |  | | 2 |  |  |  |  |  |  |  |  |  |  |  |  | 2 | | |  |  |  |  |  |  |  |  |  |  |  |  | | | | | a | | b | | c | | d | | e | | f | |
| generated by
| Code: |
[hexboard]e e e e e e
e e e e e e[/hexboard] |
|
|
 |
| CrystyB |
Posted: Tue Feb 01, 2005 11:39 pm Post subject: -32 |
|
OMFG!!! I tried to put the URL, to let the wiki engine come up with the link, and instead got the pic!!!
Jeep, thanks for the thought, but even if you would've enabled uploads, i would've had no idea how to use them...
@ Chuck |
|
 |
| Chuck |
Posted: Tue Feb 01, 2005 11:15 pm Post subject: -33 |
|
| We should have generic game tags where the user supplies the images for the board and pieces. The user specifies within the tag where in the board image the center of each piece image goes. If pieces overlap the last one placed would be on top. Then we would never need to add more game tags. |
|
 |
| jeep |
Posted: Tue Feb 01, 2005 10:47 pm Post subject: -34 |
|
Oh, sorry.
I have uploads turned off right now. I'll turn them on when I get home. You can link it for now, if you wish.
-JEEP |
|
 |
| CrystyB |
Posted: Tue Feb 01, 2005 10:26 pm Post subject: -35 |
|
I had a hunch that was the reason. But this isn't even remotely supposed to be PGN, so why not do it the other way around? Not everybody knows that black starts a game of Go...
And you haven't answered my inquiry about pictures in wiki... Am i supposed to simply link to it, instead of including it in the page (as in an IMG-like kind of way)? |
|
 |
| jeep |
Posted: Tue Feb 01, 2005 10:21 pm Post subject: -36 |
|
Heh, true I look for the tags in a fixed order because it's easier than looping through each existing tag. For tagless games, it's extra processing, but at some point it becomes more efficient, so I suppose I'll change it eventually.
The reason it's ordered that way for black and white is because that's the order they are listed in the PGN spec. and I just reused the same code.
-JEEP |
|
 |
| CrystyB |
Posted: Tue Feb 01, 2005 9:24 pm Post subject: -37 |
|
Nah, it was just the pretext i needed to go edit that wiki page on mafscum. I'm almost done, but... i can't find a way to upload my pic (i have it in my glpics account until further developments) and put it in the page...
New idea: something i kinda dislike about the subtags is that no matter their order, the player with white stones will always be put above the player with black stones. Which is ridiculous, IMO. |
|
 |
| jeep |
Posted: Tue Feb 01, 2005 8:46 pm Post subject: -38 |
|
I thought about mentioning the spaces and comma thing, but I am thinking about how to remove that restriction. Since the alias is enclosed in braces, it shouldn't be too difficult, I just can't quite get the regular expression perfect.
As to the PS, is that good or bad?
-JEEP |
|
 |