Fájl:Random go position.png

Az oldal más nyelven nem érhető el.
A Wikipédiából, a szabad enciklopédiából

Eredeti fájl(2 497 × 2 497 képpont, fájlméret: 334 KB, MIME-típus: image/png)

A Go position, used to illustrate the rules of Go.

David Benbennick made it with the following Metapost program, modified slightly from the code at Image:Go position, life and death, 1.png:

scale=0.6in;   % scale is the diameter of a stone
linethickness = scale/25;
pickup pencircle scaled linethickness;
num = 150;  % Levels of shading in each stone.

color shadow;
shadow = (0.44,0.36,0.18);

lx = -0.35;
ly = 0.35;
lz = sqrt(1-lx*lx-ly*ly);
  % light source direction vector.
  % note that lz = cos(ltip).
ltheta = angle(lx, ly);
ltip = angle(lz, lx++ly);
  % the angle at which the light source is tipped.

path ellipse;
ellipse := fullcircle scaled scale xscaled lz;


% First, we draw the black stone, and a special version for the bottom row:
picture blackstone;
blackstone = currentpicture;
picture blackstoneb;
blackstoneb = currentpicture;
picture blackstoner;
blackstoner = currentpicture;

addto blackstone contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto blackstoneb contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto blackstoner contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto blackstone doublepath (0.55*scale,0)--(0,0)--(0,-0.55*scale)
  withpen currentpen;
addto blackstoneb doublepath (0.55*scale,0)--(0,0)
  withpen currentpen;
addto blackstoner doublepath (0,-0.55*scale)--(0,0)
  withpen currentpen;
addto blackstone contour fullcircle scaled scale;
addto blackstoneb contour fullcircle scaled scale;
addto blackstoner contour fullcircle scaled scale;

for ratio = 1 step -1/num until 0 :
  path ourellipse;
  ourellipse = ellipse scaled ratio
    shifted (scale*(1+-+ratio)*sind(ltip)/2, 0)
    rotated ltheta;

  addto blackstone contour ourellipse withcolor (0.7*(1+-+ratio)**2*white);
  addto blackstoneb contour ourellipse withcolor (0.7*(1+-+ratio)**2*white);
  addto blackstoner contour ourellipse withcolor (0.7*(1+-+ratio)**2*white);
endfor;


% Next, we draw a white stone, and a special version for the bottom row:
picture whitestone;
whitestone = currentpicture;
picture whitestoneb;
whitestoneb = currentpicture;
picture whitestoner;
whitestoner = currentpicture;

basewhite = 0.7;
addto whitestone contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto whitestoneb contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto whitestoner contour fullcircle scaled scale
  shifted (0.05*scale*dir(ltheta+180)) 
  withcolor shadow;
addto whitestone doublepath (0.55*scale,0)--(0,0)--(0,-0.55*scale)
   withpen currentpen;
addto whitestoneb doublepath (0.55*scale,0)--(0,0) withpen currentpen;
addto whitestoner doublepath (0,-0.55*scale)--(0,0) withpen currentpen;
addto whitestone contour fullcircle scaled scale
   withcolor (basewhite*white);
addto whitestoneb contour fullcircle scaled scale
   withcolor (basewhite*white);
addto whitestoner contour fullcircle scaled scale
   withcolor (basewhite*white);

for ratio = 1 step -1/num until 0 :
  path ourellipse;
  ourellipse = ellipse scaled ratio
    shifted (scale*(1+-+ratio)*sind(ltip)/2, 0)
    rotated ltheta;

  addto whitestone contour ourellipse withcolor
    (basewhite + (1-basewhite)*((1+-+ratio)**4))*white;
  addto whitestoneb contour ourellipse withcolor
    (basewhite + (1-basewhite)*((1+-+ratio)**4))*white;
  addto whitestoner contour ourellipse withcolor
    (basewhite + (1-basewhite)*((1+-+ratio)**4))*white;
endfor;


boardwidth = 5;
boardheight = 5;
  % a 5-by-5 positions of a go board.

def drawboard = 
  pickup pencircle scaled linethickness;
  fill unitsquare xscaled ((boardwidth+0.2)*scale)
    yscaled ((boardheight+0.2)*scale) shifted (-0.6*scale, -0.6scale)
    withcolor (0.86,0.70,0.36);
  for i = 0 upto boardwidth - 1 :
    draw (scale*i,0) -- (scale*i, (boardheight-1)*scale);
  endfor;
  for j = 0 upto boardheight - 1 :
    draw (0,scale*j) -- ((boardwidth-1)*scale,scale*j);
  endfor;
enddef;

def wh(expr x, y) =
  if y = 0 :
    draw whitestoneb shifted (x*scale, y*scale);
  elseif x = boardwidth - 1 :
    draw whitestoner shifted (x*scale, y*scale);
  else :
    draw whitestone shifted (x*scale, y*scale);
  fi;
enddef;
def bl(expr x, y) =
  if y = 0 :
    draw blackstoneb shifted (x*scale, y*scale);
  elseif x = boardwidth - 1 :
    draw blackstoner shifted (x*scale, y*scale);
  else :
    draw blackstone shifted (x*scale, y*scale);
  fi;
enddef;
def lab(expr num, x, y, color) =
  draw thelabel(num, (0, 0)) scaled (0.75*scale/10pt)
    shifted (x*scale, y*scale) withcolor color;
enddef;


beginfig(1);
  drawboard;

  bl(1,4);bl(4,4);bl(0,3);bl(1,3);wh(3,3);bl(4,3);wh(2,2);wh(0,1);
  wh(2,1);bl(3,1);wh(4,1);bl(1,0);wh(2,0);wh(3,0);

 currentpicture := currentpicture shifted (3in, 3in);
endfig;
end;

With the above code as Random_go_position.mp, run

mpost Random_go_position.mp
convert -density 800 Random_go_position.1 Random_go_position.pnm
pnmcrop Random_go_position.pnm | pnmtopng > Random_go_position.png.uncrush
pngcrush -reduce -brute -l 9 Random_go_position.png.uncrush Random_go_position.png

to reproduce this image.

Én, e mű szerzője a művemet az alábbi licencek alatt teszem közzé:
GNU head Ez a fájl szabadon másolható, terjeszthető és/vagy módosítható a GNU Szabad Dokumentációs Licenc feltételei alapján, az 1.2 vagy későbbi, a Free Software Foundation által publikált Nem Változtatható szakaszok, Címlapszövegek és Hátlapszövegek nélküli változat szerint. E licenc egy példánya a GNU Szabad Dokumentációs Licenc című fejezetben olvasható.
w:hu:Creative Commons
Nevezd meg! Így add tovább!
Ez a fájl a Creative Commons Nevezd meg! – Így add tovább! 3.0 Unported licenc alapján használható fel.
A következőket teheted a művel:
  • megoszthatod – szabadon másolhatod, terjesztheted, bemutathatod és előadhatod a művet
  • feldolgozhatod – származékos műveket hozhatsz létre
Az alábbi feltételekkel:
  • Nevezd meg! – A szerzőt megfelelően fel kell tüntetned, hivatkozást kell létrehoznod a licencre és jelezned kell, ha a művön változtatást hajtottál végre. Ezt bármilyen észszerű módon megteheted, kivéve oly módon, ami azt sugallná hogy a jogosult támogat téged vagy a felhasználásod körülményeit.
  • Így add tovább! – Ha megváltoztatod, átalakítod, feldolgozod ezt a művet, a közreműködésedet csak az eredetivel megegyező vagy hasonló licenc alatt terjesztheted.
Ez a licenc a GFDL licenccsere során került a fájlra.
w:hu:Creative Commons
Nevezd meg! Így add tovább!
Ez a fájl a Creative Commons Nevezd meg! – Így add tovább! 2.0 Generic licenc alapján használható fel.
A következőket teheted a művel:
  • megoszthatod – szabadon másolhatod, terjesztheted, bemutathatod és előadhatod a művet
  • feldolgozhatod – származékos műveket hozhatsz létre
Az alábbi feltételekkel:
  • Nevezd meg! – A szerzőt megfelelően fel kell tüntetned, hivatkozást kell létrehoznod a licencre és jelezned kell, ha a művön változtatást hajtottál végre. Ezt bármilyen észszerű módon megteheted, kivéve oly módon, ami azt sugallná hogy a jogosult támogat téged vagy a felhasználásod körülményeit.
  • Így add tovább! – Ha megváltoztatod, átalakítod, feldolgozod ezt a művet, a közreműködésedet csak az eredetivel megegyező vagy hasonló licenc alatt terjesztheted.
A mű a fenti licencek bármelyike szerint felhasználható.

Képaláírások

Adj meg egy egysoros magyarázatot arról, hogy mit mutat be ez a fájl

A fájl által ábrázolt elemek

mű tárgya

Fájltörténet

Kattints egy időpontra, hogy a fájl akkori állapotát láthasd.

Dátum/időBélyegképFelbontásFeltöltőMegjegyzés
aktuális2005. február 18., 05:53Bélyegkép a 2005. február 18., 05:53-kori változatról2 497 × 2 497 (334 KB)Dbenbennmade by me, {{GFDL}}

Globális fájlhasználat

A következő wikik használják ezt a fájlt: