It is currently Wed Apr 24, 2024 6:50 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 17 posts ] 
Author Message
 Post subject: checkers, (nl: DAMMEN) needs helpers
PostPosted: Thu Jan 12, 2017 12:16 pm  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: New User



Hallo and happy New Year

Gave as gift a checkers game to my son (in law). Found, that in the foregoing century I had buyed a beginners book about checkers:
Attachment:
dammen5.jpg
dammen5.jpg [ 114.99 KiB | Viewed 7972 times ]

Learning from that book is for a large part via given situations, to find the winning solution.

There are a lot of checkers addons for an Ipad, but none was suitable to setup a problem given in the book that made me thinking of using Gimp!
The picture above is made with Gimp and (my) guidelab_paint.py plugin and if some is interested to help me ???
The latest version of the plugin can save and read helpline coordinates, so probably already suitable to be used (as is done to build the picture above) ;-).
As well it can put patterns into selected selections (meaning I will use a nice one for black and white stones, not only circles as is done above) ...

I think it is a nice adventure ...

Greets
Peter


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Fri Jan 13, 2017 1:42 am  (#2) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7713
Location: On the other side of this screen
Hi PKHG. nice checkers board.
What exactly do you need help with?

_________________


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Fri Jan 13, 2017 3:21 am  (#3) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Oh, this board is just the starting. Need an UI, to move stones (pygtk) and reading a file with an inbetween game to setup the board.
And someone looking at my code and maybe with suggestions to do this or that more clever ;-)

Peter
the history lines of the guides look like this (this morning)
'[];[]'
"[150, 350, 550, 750, 950];[50, 250, 450, 650, 850]"
"[50, 250, 450, 650, 850];[50, 250, 450, 650, 850]" (wrong one replaced by next line)
"[50, 250, 450, 650, 850];[150, 350, 550, 750, 950]"
"[50, 250];[150, 350, 550, 750, 950]"
"[150, 350];[50, 250, 450, 650, 850]"
"[750, 950];[50, 250, 450, 650, 850]"
"[650, 850];[150, 350, 550, 750, 950]"

first lists are horizontal guides values, second vertical ones.
The last four are used to put black resp. white stones at their starting position
The first two are used to fill the board all ' dark brown fields.

Meaning, that a an inbetween broken game recorded as:
Attachment:
IMG_3149_klein.jpg
IMG_3149_klein.jpg [ 88.93 KiB | Viewed 7866 times ]


Need some (helping) ideas ...


Top
 Post subject:
PostPosted: Fri Jan 13, 2017 6:25 am  (#4) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
now the stones are patterns not filled circles
Attachment:
dammen_start_stenen.jpg
dammen_start_stenen.jpg [ 83.17 KiB | Viewed 7851 times ]

Now I changed the history saving and reading, such that comment is possible:
"[150, 350, 550, 750, 950];[50, 250, 450, 650, 850];' lines 1 3 ..."
"[50, 250, 450, 650, 850];[150, 350, 550, 750, 950];' lines 0 2 ..."
"[50, 250];[150, 350, 550, 750, 950];'black 0 2'"
"[150, 350];[50, 250, 450, 650, 850];'black 1 2'"
"[750, 950];[50, 250, 450, 650, 850];'white 7 9' "
"[650, 850];[150, 350, 550, 750, 950];'white 6 8'"
"[125, 375];[125, 375];'changme test"

So at this moment I could/will make a replacement, to setup an inbetween game
by making a suitable history file (different name)
So I need some rename support in the GUI ;-)

Next: a GUI moving stones ... but that is probably not so difficult (if all stones involved are given to pyton in Gimp)


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Fri Jan 13, 2017 9:22 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Find the x and y coordinates of the center of each existing square center point and allow each square to be named in an array as such. Then allow a clickable x y point entry on the dialog widget (drop down menu or such) to tell the script to cut and paste the pattern to the new coordinate on the board. Or you could add a clickable board view to the widget.
You could visually add those x y coordinates written on each square also for easier user movement entries of game pieces.

Just a thought. :) I am not a Python coder so.

Cool idea.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Fri Jan 13, 2017 9:41 am  (#6) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
thanks, the idea of a bord to click at from out of a GUI, is perfect!
coordinates, x,y, are clear and done already, the intersections of guides (so VERY easy)

Thanks
Peter


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Sat Jan 14, 2017 9:42 am  (#7) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
One of the reasons of this thread make a copy of an excersize, to start later an animation ..
for a solution (and make histories for later)

The input looks for this excersise like this:
nr21black=[1,2,12,14,15,16,18,20,23] in usual notation
nr21white=[27, 31,33, 36, 38, 39, 43, 48,49]
converted by Gimp (Python!) to
pixel values for a 1000 x 1000 (px x px) board, essential part of my guides history:
"[250];[350, 750, 950];black 250"
"[450];[550];black 450"
"[50];[150, 350];black 50"
"[350];[50, 450, 850];black 350"
"[250];[350, 750, 950];black 250"
"[750];[50, 450, 650];white750"
"[650];[150, 550];white650"
"[550];[250];white550"
"[850];[550];white850"
"[950];[450, 650];white950"
using guide_paint to paint this gave:

Attachment:
opg21_OK.jpg
opg21_OK.jpg [ 78.71 KiB | Viewed 7781 times ]


So start seems to be made (easy part I think)
Next step in automatization is to let the plugin do alle the clicks after pushing: implement
the guides file
Greets
Peter

EDIT: forgotten to tell: White to play and win ;-)


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Sun Jan 15, 2017 5:31 am  (#8) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Succes,
Only this input is needed and some few clicks gives the picture above:
blacknr21=[1,2,12,14,15,16,18,20,23]
whitenr21=[27, 31,33, 36, 38, 39, 43, 48,49]

the 21 is coming from the book, exercise 21 ;-).

now checking nr 22 ;-)

OK, too white to start
Attachment:
dam_exerc22.jpg
dam_exerc22.jpg [ 83.49 KiB | Viewed 7734 times ]


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Jan 16, 2017 5:14 am  (#9) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
So now all pieces are movable on the Gimp-window (100x100) using pickup with the mouse and move a piece where you like:
So missing the 'magnetic' property to snap the peace to a dark field on the board.
Maybe a plugin has to be written: adjust peaces to the next neighboring field?!
Ideas for this problem are welcome ;-).

the picture to play with:
Attachment:
dammen_startboard_movable_pieces_.xcf [1.23 MiB]
Downloaded 249 times


Comments?


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Jan 16, 2017 6:04 am  (#10) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Hm, just discovered, there are java script HTML-pages ;-(
OK, but it is nevertheless fun to try checkers in Gimp ;-)

Edit: but a lot of progress has been accomplished
Moving stones (black or white) works, an easy jump worked (a bit)
a several steps jump is a TODO as is moving a promoted stone a dam (? English?)

but working on is is great pleasure :yes


Last edited by PKHG on Mon Jan 30, 2017 11:11 am, edited 1 time in total.

Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Jan 16, 2017 8:21 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I once saw a battleship game written in Java HTML as well. :)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Feb 13, 2017 9:17 am  (#12) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
So, an important part is done!
A starting picture with stones as layers is used with an mini Pygtk UI to say which stone has to go where (if it is just a bit more matured you will get the plugin ).

Here a first result: too a bit reason for this project:

Attachment:
goenzetx600.gif
goenzetx600.gif [ 84.57 KiB | Viewed 4897 times ]


If black knows, he will capture 2 white stones ... to be shown soon :yes

Idea: white tries to save his/her foremost stone against capture but done with a wrong stone!


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Thu Feb 23, 2017 6:32 am  (#13) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
So, my checker-plugin works already nicely, inclusiv movement and jumps of a Dam (=promoted stone)

Here the output of demonstrating an beginners ERROR (= groenzet).
The next line is created by the plugin:
"start_dambordOK.xcf\r\n"[32, 28][18, 23][37, 32][23, 29][34, 29, 23][17, 22][28, 22, 17][19, 23, 28][28, 32, 37][37, 31, 26]

Updated (yet by hand) it becomes in international notation this:
"groenzet: start_dambordOK.xcf"1. 32 - 28 2. 18 - 23 3. 37 - 32?? 4. 23 - 29 5. 34 - 23 6. 17 - 22 7. 28 x 17 8. [19 x 28 28 x 37 37 x 26]

If interested in start_dambordOK.xcf and the plugin to play 'checkers' with Gimp
send me a personal mail.

The PyGtk (NEEDED!!!) UI for my plugin looks like:
Attachment:
startUIdammen.jpg
startUIdammen.jpg [ 34.74 KiB | Viewed 4859 times ]


Next problem: How to make the UI international?
Need Gimp help for using gettext and friends.
Am on Windows, but I think most of (all?) programs for gettext are available.

Any hint is apreciated (or even real help)

E.g. in Gimp 2.10 I am not yet able to resize the black-pieces pattern
savin a 100x100 image as pattern did not work????!!!!


Last edited by PKHG on Mon Oct 28, 2019 11:11 am, edited 1 time in total.

Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Oct 28, 2019 11:08 am  (#14) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
I am on the way to use Gimp (again) as playing-bord for CHECKERS

It works again to some extent, BUT I come across a very strange thing
Letting the plugin insert black pieces they are NOT entered
Same way for white pieces , all is OK
???
Eventually, the two patterns are different
black 97x100 white 100x100
But why that strange shift???

Ideas?


Attachments:
Screen Shot 2019-10-28 at 16.46.38.png
Screen Shot 2019-10-28 at 16.46.38.png [ 28.6 KiB | Viewed 4517 times ]
Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Mon Oct 28, 2019 3:26 pm  (#15) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
Because the (visible) pieces fall on 97, then 3*97=291, then 5*97=485, etc, so each piece appears shifted 6px more than the one on its left.

_________________
Image


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Tue Oct 29, 2019 1:55 am  (#16) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Ofnuts, you are right ;-)

I made a new 100x100 black circle pattern and in the plugin
THAT behaves as wanted.
Now I have to solve the problem to update that black pattern (with Wilber on it) to 100x100.

Thanks and see you later
Peter


Top
 Post subject: Re: checkers, (nl: DAMMEN) needs helpers
PostPosted: Wed Oct 30, 2019 11:09 am  (#17) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Hi, Gimp as checker-board with GTK works again
Have al look:
https://github.com/PKHG/guidelab_paint
Read the Readme
Problems? I will be informed if you ask here ;-)

Have a nice day
Peter


Top
Post new topic Reply to topic  [ 17 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Sorry, again checkers

0



* Login  



Powered by phpBB3 © phpBB Group