It is currently Wed Apr 24, 2024 3:03 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
Offline
 Post subject: Swap colors in sgf
Post #1 Posted: Sat Sep 30, 2017 10:21 am 
Dies in gote

Posts: 42
Liked others: 17
Was liked: 9
Rank: KGS 10 kyu
KGS: anpd
Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.

Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #2 Posted: Sat Sep 30, 2017 11:09 am 
Beginner

Posts: 12
Liked others: 14
Was liked: 6
Rank: SDK
Drago has a feature to swap colors.

Just load the position, click View -> Swap colors and save it.

Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #3 Posted: Sat Sep 30, 2017 12:22 pm 
Dies in gote

Posts: 42
Liked others: 17
Was liked: 9
Rank: KGS 10 kyu
KGS: anpd
I tried Drago, it swaps the colors and the tree looks correct. But when saving it's the original file without the color swap, am I missing a step?

Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #4 Posted: Sat Sep 30, 2017 1:18 pm 
Beginner

Posts: 12
Liked others: 14
Was liked: 6
Rank: SDK
Well, that's a tad embarrassing :-? I simply assumed Drago would save the changes, but it appears to only be visual.

In that case I'm unfortunately not aware of any software that does what you want.


If worse comes to worst you can always use a text editor with a find-and-replace tool (ctrl + h in the default Microsoft Notepad) to swap the colors of the stones. Since you can replace all occurances of a given string at once this way it's at least better than doing it all by hand...

To swap all pre-placed stones, first replace "AW[" with "PLACEHOLDER", followed by replacing "AB[" with "AW[" and lastly "PLACEHOLDER" with "AB[".

For the solutions, find and replace ";W[" with "PLACEHOLDER", followed by ";B[" with ";W[" and finally "PLACEHOLDER" with ";B[".


This post by Kap was liked by: anpd
Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #5 Posted: Sat Sep 30, 2017 2:01 pm 
Beginner

Posts: 15
Liked others: 0
Was liked: 3
anpd wrote:
Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.

Try sgftf.

Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #6 Posted: Sat Sep 30, 2017 2:22 pm 
Dies in gote

Posts: 42
Liked others: 17
Was liked: 9
Rank: KGS 10 kyu
KGS: anpd
zorq wrote:
anpd wrote:
Hi anyone know of an easy way to swap colors of a sgf file? It's for tsumego files.

Try sgftf.


Thanks, looks like that will work :)

Top
 Profile  
 
Offline
 Post subject: Re: Swap colors in sgf
Post #7 Posted: Sat Sep 30, 2017 2:23 pm 
Dies in gote

Posts: 42
Liked others: 17
Was liked: 9
Rank: KGS 10 kyu
KGS: anpd
Kap wrote:
Well, that's a tad embarrassing :-? I simply assumed Drago would save the changes, but it appears to only be visual.

In that case I'm unfortunately not aware of any software that does what you want.


If worse comes to worst you can always use a text editor with a find-and-replace tool (ctrl + h in the default Microsoft Notepad) to swap the colors of the stones. Since you can replace all occurances of a given string at once this way it's at least better than doing it all by hand...

To swap all pre-placed stones, first replace "AW[" with "PLACEHOLDER", followed by replacing "AB[" with "AW[" and lastly "PLACEHOLDER" with "AB[".

For the solutions, find and replace ";W[" with "PLACEHOLDER", followed by ";B[" with ";W[" and finally "PLACEHOLDER" with ";B[".


Yes was hoping to avoid that, will try zorq's suggestion. Otherwise I will have to do that.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group