See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
그림:Random go position.png - 위키백과

그림:Random go position.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.

I, the copyright holder of this work, hereby publish it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation license, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation license".

Aragonés | العربية | Asturianu | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | Bahasa Melayu | Nnapulitano | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | తెలుగు | ไทย | Türkçe | Українська | اردو | Tiếng Việt | Volapük | Yorùbá | ‪中文(中国大陆)‬ | ‪中文(台灣)‬ | +/-

Creative Commons License
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under Creative Commons Attribution ShareAlike 2.0 License (cc-by-sa-2.0). In short: you are free to share and make derivative works of the file under the conditions that you appropriately attribute it, and that you distribute it under this or a similar cc-by-sa license.
You may select the license of your choice.

파일 역사

날짜/시간을 누르면 당시의 파일을 볼 수 있습니다.

날짜/시간크기사용자내용
현재2005년 2월 18일 (금) 12:532,497×2,497 (334 KB)Dbenbenn (made by me, {{GFDL}})


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -