| View previous topic :: View next topic |
| Author |
Message |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 1:27 pm Post subject: 81 |
|
|
Ugh! Page 3... i better quote the message i was addressing...
| jeep wrote: |
It does mean a little typing when you need to capture a group though.
Just remember you can rename a move with braces, so if you place a stone on J8, capturing two stones you won't have to see:
in the move list, it can be aliased like so:
-JEEP |
Umm... What??
Went to http://www.mafiascum.net/cgi-bin/wiki.pl?Go , and while i understand your J8+-j7+-j6*2 ( i see in the documentation that the "+-" got replaced by "-", in the sixth <li>, and i think that's a typo; i won't correct it though, because i'm not sure what works. Should i start testing the GL tags and see what works?), i am stumped as to why in the world would i increase the charcount of the move i'm typing... 12 is high enough, considering i'm only capturing two stones; why would i do it 17?? |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Tue Feb 01, 2005 5:45 pm Post subject: 82 |
|
|
test
| White: vinny Black: crystyb
| 1 | c3=b1 | d3=w2 | | 2 | e3=b3 | d2=w4 | | 3 | d4=b5 | b3=w6 | | 4 | c2=b7 | b2=w8 | | 5 | e2=b9 | c4=w10 | | 6 | d1=b11+-d2+-d3*2 | | Prisoners | 2 | 0 |
|
[edit]nm, code is perfect [/edit]
Last edited by Vinny on Tue Feb 01, 2005 6:56 pm; edited 2 times in total |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Tue Feb 01, 2005 5:49 pm Post subject: 83 |
|
|
test 2 without the numbered pieces
| White: vinny Black: crystyb
| 1 | c3 | d3 | | 2 | e3 | d2 | | 3 | d4 | b3 | | 4 | c2 | b2 | | 5 | e2 | c4 | | 6 | d1+-d2+-d3*2 | d3 | | 7 | d2+-d3*1 | b4 | | 8 | b5 | b6 | | 9 | c7 | c5 | | 10 | c6 | b7 | | 11 | b8 | a5+-b5*1 | | 12 | a8 | d5 | | 13 | e4 | d7 | | 14 | c8 | d8 | | Prisoners | 3 | 1 |
|
Last edited by Vinny on Tue Feb 01, 2005 7:09 pm; edited 1 time in total |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Tue Feb 01, 2005 5:51 pm Post subject: 84 |
|
|
and what's the point of aliasing?
test
| White: vinny Black: crystyb
| 1 | c3 | d3 | | 2 | e3 | d2 | | 3 | d4 | b3 | | 4 | c2 | b2 | | 5 | e2 | c4 | | 6 | d1* | | Prisoners | 2 | 0 |
|
Ah I see! To show cleaner notations on the right of the board! gotcha.
Last edited by Vinny on Tue Feb 01, 2005 7:10 pm; edited 1 time in total |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 6:09 pm Post subject: 85 |
|
|
Vin: you typo'ed -d2...
2. Ah, i guess looking at a post made through goboard made me believe we aren't supposed to see the moves on the right...  |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Tue Feb 01, 2005 6:56 pm Post subject: 86 |
|
|
doh!
nm jeep, my bad. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 7:05 pm Post subject: 87 |
|
|
| -1: In move number: 1, c3=b1{c3 [lower
left]...} is not valid and has been skipped Event: test
| 1 | c3=b1{c3 [lower
left]...} | d3 (aggressive, ain't it? " ") | | 2 | e3 | d2 | | 3 | d4 | b3 | | 4 | c2 | b2 | | 5 | e2 | c4 | | 6 | d1 (captures 2) | | Prisoners | 2 | 0 |
|
One comment: I think you should mention we are to keep the alias free of any spaces and commas...
PS Sure enough, leaving the plus's out generates and IMG tag for b11-d2-d3*2.gif While removing the "=b11" returns an error: "-1: In move number: 6, d1-d2-d3*2 is not valid and has been skipped"
[edit]Just being mean 
Last edited by CrystyB on Mon Feb 07, 2005 8:38 pm; edited 1 time in total |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Tue Feb 01, 2005 8:46 pm Post subject: 88 |
|
|
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 |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 9:24 pm Post subject: 89 |
|
|
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. |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Tue Feb 01, 2005 10:21 pm Post subject: 90 |
|
|
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 |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 10:26 pm Post subject: 91 |
|
|
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)? |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Tue Feb 01, 2005 10:47 pm Post subject: 92 |
|
|
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 |
|
| Back to top |
|
 |
Chuck
Daedalian Member
|
Posted: Tue Feb 01, 2005 11:15 pm Post subject: 93 |
|
|
| 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. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Tue Feb 01, 2005 11:39 pm Post subject: 94 |
|
|
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 |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Wed Feb 02, 2005 12:17 am Post subject: 95 |
|
|
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] |
|
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Wed Feb 02, 2005 12:41 am Post subject: 96 |
|
|
Yeah, I fixed that, but haven't release it. I hoped no one would notice
-JEEP |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Wed Feb 02, 2005 1:09 am Post subject: 97 |
|
|
| 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. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Wed Feb 02, 2005 1:13 am Post subject: 98 |
|
|
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"? |
|
| Back to top |
|
 |
mathgrant
A very tilted cell member
|
Posted: Wed Feb 02, 2005 1:57 am Post subject: 99 |
|
|
| 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. _________________ My logic puzzle blog |
|
| Back to top |
|
 |
wordcross

|
Posted: Wed Feb 02, 2005 4:44 am Post subject: 100 |
|
|
| 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? _________________ Has anyone really been far even as decided to use even go want to do look more like? |
|
| Back to top |
|
 |
mathgrant
A very tilted cell member
|
Posted: Wed Feb 02, 2005 5:48 am Post subject: 101 |
|
|
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 _________________ My logic puzzle blog |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Wed Feb 02, 2005 6:48 am Post subject: 102 |
|
|
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 |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Wed Feb 02, 2005 8:56 am Post subject: 103 |
|
|
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 |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Wed Feb 02, 2005 9:09 am Post subject: 104 |
|
|
| 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...).  |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Wed Feb 02, 2005 4:52 pm Post subject: 105 |
|
|
| 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! |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Wed Feb 02, 2005 4:55 pm Post subject: 106 |
|
|
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? |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Wed Feb 02, 2005 5:08 pm Post subject: 107 |
|
|
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. |
|
| Back to top |
|
 |
mathgrant
A very tilted cell member
|
Posted: Wed Feb 02, 2005 6:31 pm Post subject: 108 |
|
|
| 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.    _________________ My logic puzzle blog |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Wed Feb 02, 2005 7:11 pm Post subject: 109 |
|
|
| 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. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Wed Feb 02, 2005 8:11 pm Post subject: 110 |
|
|
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)... |
|
| Back to top |
|
 |
Vinny
Promiscuous enough
|
Posted: Wed Feb 02, 2005 11:18 pm Post subject: 111 |
|
|
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. |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Wed Feb 02, 2005 11:26 pm Post subject: 112 |
|
|
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 |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Thu Feb 03, 2005 10:28 am Post subject: 113 |
|
|
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 |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Thu Feb 03, 2005 11:20 am Post subject: 114 |
|
|
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 |
|
| Back to top |
|
 |
Lucky Wizard
Daedalian Member
|
Posted: Fri Feb 04, 2005 6:39 am Post subject: 115 |
|
|
| 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. |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Fri Feb 04, 2005 8:16 am Post subject: 116 |
|
|
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. |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Sat Feb 05, 2005 10:49 am Post subject: 117 |
|
|
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.
Last edited by CrystyB on Sat Feb 05, 2005 9:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
CrystyB
Misunderstood Guy
|
Posted: Sat Feb 05, 2005 3:29 pm Post subject: 118 |
|
|
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. |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Sat Feb 05, 2005 11:11 pm Post subject: 119 |
|
|
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 |
|
| Back to top |
|
 |
jeep
Daedalian Member
|
Posted: Sun Feb 06, 2005 1:45 am Post subject: 120 |
|
|
        
        
        
        
        
        
        
        
        
| 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
|
|
|
| Back to top |
|
 |
|