It is currently Thu Aug 17, 2017 8:05 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
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: 102
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 1075 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
GimpChat Member
User avatar

Joined: Apr 01, 2012
Posts: 4671
Location: In front of my computer
Hi PKHG. nice checkers board.
What exactly do you need help with?

_________________
Image


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: 102
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 969 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: 102
now the stones are patterns not filled circles
Attachment:
dammen_start_stenen.jpg
dammen_start_stenen.jpg [ 83.17 KiB | Viewed 954 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: 13885
Location: "Looking for my eraser" =P
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


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: 102
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: 102
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 884 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: 102
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 837 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: 102
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 44 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: 102
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 new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group