{"id":1421,"date":"2005-04-11T08:39:09","date_gmt":"2005-04-11T08:39:09","guid":{"rendered":"http:\/\/dev.jblove.net\/?p=1421"},"modified":"2005-04-11T08:39:09","modified_gmt":"2005-04-11T08:39:09","slug":"%eb%a7%90%ea%b2%bd%ec%a3%bc-%ec%86%8c%ec%8a%a4%ec%82%ac%eb%8b%a4%eb%a6%ac%ed%83%80%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/jblove.net\/?p=1421","title":{"rendered":"\ub9d0\uacbd\uc8fc \uc18c\uc2a4(\uc0ac\ub2e4\ub9ac\ud0c0\uae30)"},"content":{"rendered":"<p><HTML><br \/>\n<HEAD><br \/>\n<TITLE> Script Game ::: Race :::<\/TITLE><\/p>\n<p>\t<Script Language=\"javascript\"><br \/>\n\t\t\/*<br \/>\n\t\t* \uc791\uc131 : \uc784\uc131\ud638<br \/>\n\t\t* \uc0ac\ub2e4\ub9ac \uadf8\ub9ac\uae30\uac00 \uadc0\ucc2e\uc544 \ud558\ub098 \ub9cc\ub4e4\uc5b4 \ubcf4\uc558\uc2b5\ub2c8\ub2e4.<br \/>\n\t\t* \ucd08\uae30\uc18d\ub3c4\ub294 \ubcc0\uc218 \uc9c0\uc815 \ud558\uc9c0 \uc54a\uc558\uc5b4\uc694.. \uadc0\ucc2e\uc74c.. ^^;;<br \/>\n\t\t* \uc0ac\ub2e4\ub9ac \ub300\uc2e0 \ud574\ubcf4\uc138\uc694.. \uc7bc\ub098\uc5ec \u314b ^^;;;<br \/>\n\t\t*\/<br \/>\n\t\tvar timeID; <br \/>\n\t\tvar isOver = false;<br \/>\n\t\t\/\/horse count<br \/>\n\t\tvar horseCount = 5;<br \/>\n\t\t\/\/run zone width<br \/>\n\t\tvar tableWidth = 800;<br \/>\n\t\t\/\/timeSet <br \/>\n\t\tvar timeSet = 1000;<\/p>\n<p>\t\tvar winner = 0;<br \/>\n\t\t\/\/first horse  :: value of the width<br \/>\n\t\tvar f_horse_1 = 10;<br \/>\n\t\tvar f_horse_2 = 10;<br \/>\n\t\tvar f_horse_3 = 10;<br \/>\n\t\tvar f_horse_4 = 10;<br \/>\n\t\tvar f_horse_5 = 10;<\/p>\n<p>\t\tvar isA = 0;<br \/>\n\t\tvar isB = 0;<br \/>\n\t\tvar isC = 0;<br \/>\n\t\tvar isD = 0;<br \/>\n\t\tvar isE = 0;<\/p>\n<p>\t\t\/*<br \/>\n\t\t* setInit<br \/>\n\t\t* \ucd08\uae30\ud654 \ud568\uc218<br \/>\n\t\t* @param isNew \ud788\ub4e0 \ud14c\uadf8\ub97c \uadf8\ub9b0\ud6c4 , \ub2e4\uc2dc \ud638\ucd9c\ub420\ub54c \uc911\ubcf5 \ud638\ucd9c\uc744<br \/>\n\t\t* \ub9c9\uae30\uc704\ud574 \uc784\uc758\uc801\uc73c\ub85c \uc9c0\uc815\ud55c \uac12 <br \/>\n\t\t* 0 :: \ud788\ub4e0\ud0dc\uadf8\ub97c \ubd80\ub974\uae30 \uc804<br \/>\n\t\t* 1 :: \ud788\ub4e0\ud0dc\uadf8\ub97c \ubd80\ub978 \ud6c4<br \/>\n\t\t*\/<br \/>\n\t\tfunction setInit(isNew) {<br \/>\n\t\t\tsetMapTags();<br \/>\n\t\t\tsetHorseTags();<br \/>\n\t\t\tif(isNew == 0) setHiddenTag();<br \/>\n\t\t}<\/p>\n<p>\t\t\/*<br \/>\n\t\t* setMapTags<br \/>\n\t\t* \ub9d0\uacfc \ub9d0\uc774 \ub2ec\ub9b4 \ud14c\uc774\ube14 \ud0dc\uadf8\ub97c \uadf8\ub9ac\ub294 \ud568\uc218<br \/>\n\t\t*\/<br \/>\n\t\tfunction setMapTags() {<br \/>\n\t\t\tvar mapTag;<br \/>\n\t\t\tvar setBg;<\/p>\n<p>\t\t\t\/\/background color of the tables<br \/>\n\t\t\tvar bgColor = new Array(&#8220;black&#8221; , &#8220;white&#8221;);<\/p>\n<p>\t\t\tmapTag = &#8220;<Table height=30 width=100% border=1>&#8220;;<\/p>\n<p>\t\t\t\tfor(var x=0; x<horseCount; x++) {<br \/>\n\t\t\t\t\tmapTag = mapTag<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/p>\n<tr>&#8221;\t<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t<\/p>\n<td height=10>\uc774\ub984 :: <input type=text size=10 value='' name='saram\"+x+\"'>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t\ub4f1\uc218 :: <input type=text size=3 value='' name='win\"+x+\"'>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t<\/td>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/tr>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/p>\n<tr>&#8221;\t<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t<\/p>\n<td height=30 id='hosrse\"+x+\"'>&nbsp;<\/td>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/tr>\n<p>&#8220;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\tmapTag = mapTag<br \/>\n\t\t\t\t\t+ &#8220;<\/Table>&#8220;;<\/p>\n<p>\t\t\tdocument.all[&#8216;newZone&#8217;].innerHTML = mapTag;<br \/>\n\t\t}<\/p>\n<p>\t\t\/*<br \/>\n\t\t* setHorseTags<br \/>\n\t\t* \ub9d0\uc744 \uadf8\ub824\uc8fc\ub294 \ud0dc\uadf8<br \/>\n\t\t*\/<br \/>\n\t\tfunction setHorseTags() {<br \/>\n\t\t\t\/\/\ub9d0\uc774 \uc788\uc744 \uc704\uce58\ub97c \uc9c0\uc815\ud574 \uc8fc\ub294 \ubcc0\uc218<br \/>\n\t\t\tvar xPoint = 10;<br \/>\n\t\t\tvar yPoint = 60;<\/p>\n<p>\t\t\tvar horseTag;<br \/>\n\t\t\tvar horse = new Array(&#8220;\u2605&#8221; , &#8220;\u25cf&#8221; , &#8220;\u25c6&#8221; , &#8220;\u25a0&#8221; , &#8220;\u25bc&#8221; , &#8220;\u2606&#8221; , &#8220;\u25ce&#8221; , &#8220;\u25c7&#8221; , &#8220;\u25a1&#8221; , &#8220;\u25bd&#8221;);<\/p>\n<p>\t\t\tfor(var x=0; x<horseCount; x++) {<br \/>\n\t\t\t\thorseTag =<br \/>\n\t\t\t\t\t\t&#8220;<DIV id='horseId\"+x+\"' style='display:block;position:absolute;left:\"+xPoint+\";top:\"+eval((yPoint*(x))+55)+\";'>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8220;<\/p>\n<table height=25 width=35>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/p>\n<tr>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t<\/p>\n<td>&#8220;<br \/>\n\t\t\t\t\t\t+\t\t\thorse[x]<br \/>\n\t\t\t\t\t\t+ &#8221;\t\t<\/td>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8221;\t<\/tr>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8220;<\/table>\n<p>&#8220;<br \/>\n\t\t\t\t\t\t+ &#8220;<\/DIV>&#8220;;<\/p>\n<p>\t\t\t\tdocument.all[&#8216;hosrse&#8217;+x].innerHTML = horseTag;<br \/>\n\t\t\t}<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\ub9d0\uc758 \uc18d\ub3c4\ub97c \ud788\ub4e0\uc73c\ub85c \uc800\uc7a5\ud558\uae30 \uc704\ud55c \ud568\uc218<br \/>\n\t\tfunction setHiddenTag() {<br \/>\n\t\t\tvar hiddenCount = document.all[&#8216;hCount&#8217;].value;<br \/>\n\t\t\tif(Number(hiddenCount) > 10) {<br \/>\n\t\t\t\talert(&#8220;10 \ub9c8\ub9ac\uc774\uc0c1\uc740 \uc548\ub418\uc5ec~~!!&#8221;);<br \/>\n\t\t\t\treturn;<br \/>\n\t\t\t}<br \/>\n\t\t\tvar hiddenTag = &#8220;&#8221;; <\/p>\n<p>\t\t\tfor(var x=0; x<Number(hiddenCount); x++) {<br \/>\n\t\t\t\thiddenTag = hiddenTag <br \/>\n\t\t\t\t\t+ &#8220;<input type='hidden' name='hiddenTag\"+x+\"' value='0'>&#8220;<br \/>\n\t\t\t\t\t+ &#8220;<input type='hidden' name='hiddenWin\"+x+\"' value='0'>&#8220;;<br \/>\n\t\t\t}<br \/>\n\t\t\thorseCount = hiddenCount;<br \/>\n\t\t\tdocument.all[&#8216;hiddenZone&#8217;].innerHTML = hiddenTag;<br \/>\n\t\t\tsetInit(1);<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\uc21c\uac04\uc21c\uac04 \ub9d0\uc758 \uc18d\ub3c4<br \/>\n\t\tvar addRunSpeed;<br \/>\n\t\t\/\/\ud788\ub4e0 \ud0dc\uadf8\uc758 \uac12\uc744 \ub2f4\uc744 \ubcc0\uc218<br \/>\n\t\tvar obj;<br \/>\n\t\t\/\/\ub3c4\ucc29 \ud588\ub294\uc9c0 \uc548\ud588\ub294\uc9c0 \ud310\ub2e8\ud558\ub294 \ubcc0\uc218<br \/>\n\t\tvar isArr = 0;<br \/>\n\t\t\/\/\ub9d0\uc774 \ub2ec\ub9ac\uac8c \ud558\ub294 \ud568\uc218 \u3161.\u3161;;<br \/>\n\t\tfunction startHorse() {<br \/>\n\t\t\tif(isOver == true) {<br \/>\n\t\t\t\talert(&#8220;\ucd08\uae30\ud654 \ubc84\ud2bc\uc744 \ub20c\ub7ec \uc8fc\uc138\uc694.&#8221;);<br \/>\n\t\t\t\treturn;<br \/>\n\t\t\t}<\/p>\n<p>\t\t\tvar defaultSpeed = 0;<br \/>\n\t\t\tvar radioCount = document.all[&#8216;speedD&#8217;].length;<br \/>\n\t\t\tfor(var x=0; x<radioCount; x++) {<br \/>\n\t\t\t\tif(document.all[&#8216;speedD&#8217;][x].checked == true) <br \/>\n\t\t\t\t\tdefaultSpeed = document.all[&#8216;speedD&#8217;][x].value;<br \/>\n\t\t\t}<\/p>\n<p>\t\t\tfor(var x=0; x<horseCount; x++) {<br \/>\n\t\t\t\taddRunSpeed = setSpeed();<\/p>\n<p>\t\t\t\tobj = eval(parseInt(document.all[&#8216;hiddenTag&#8217;+x].value) + Number(addRunSpeed));<br \/>\n\t\t\t\tdocument.all[&#8216;hiddenTag&#8217;+x].value = obj;<br \/>\n\t\t\t\tisArr = document.all[&#8216;hiddenWin&#8217;+x].value;<\/p>\n<p>\t\t\t\tif(Number(obj) >= Number(tableWidth) &#038;&#038; isArr == &#8220;0&#8221;) {<br \/>\n\t\t\t\t\tdocument.all[&#8216;hiddenWin&#8217;+x].value = &#8220;1&#8221;;<br \/>\n\t\t\t\t\twinner++;<br \/>\n\t\t\t\t\tdocument.all[&#8216;win&#8217;+x].value = winner;<br \/>\n\t\t\t\t}else if(Number(obj) >= Number(tableWidth)){<br \/>\n\t\t\t\t}else goHorse(x , obj);<br \/>\n\t\t\t}<\/p>\n<p>\t\t\tif(winner >= horseCount) {<br \/>\n\t\t\t\tisOver = true;<br \/>\n\t\t\t\tclearTimeout(timeID);<br \/>\n\t\t\t\treturn;<br \/>\n\t\t\t}else timeID = setTimeout(&#8220;startHorse()&#8221; , 100);<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\ub9d0\uc744 \uc55e\uc73c\ub85c \ub2ec\ub9ac\uac8c \ud558\ub294 \ud568\uc218 \u3161.\u3161;;<br \/>\n\t\tfunction goHorse(horse , speed) {<br \/>\n\t\t\tdocument.all[&#8216;horseId&#8217;+horse].style.left = speed;<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\ub9d0\uc758 \uc18d\ub3c4\ub97c \ub9e4 \uc21c\uac04\uc21c\uac04 \uc9c0\uc815\ud574 \uc8fc\ub294 \ud568\uc218<br \/>\n\t\tfunction setSpeed() {<br \/>\n\t\t\tvar addRunSpeed = Math.ceil(Math.random(10)*10);<\/p>\n<p>\t\t\treturn addRunSpeed;<br \/>\n\t\t}<\/p>\n<p>\t\t\/\/\ub2e4\uc2dc \uac8c\uc784\uc744 \ud560\uacbd\uc6b0 \ucd08\uae30\ud654 \ud574\uc8fc\ub294 \ud568\uc218<br \/>\n\t\tfunction reStartGame() {<br \/>\n\t\t\tif(isOver == true) {<br \/>\n\t\t\t\tsetInit(0);<br \/>\n\t\t\t\tisOver = false;<\/p>\n<p>\t\t\t\twinner = 0;<br \/>\n\t\t\t\tfor(var x=0; x<horseCount; x++) {<br \/>\n\t\t\t\t\tdocument.all[&#8216;hiddenTag&#8217;+x].value = 0;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t<\/Script><\/p>\n<p><\/HEAD><\/p>\n<p><BODY onload=\"setInit(0)\"><br \/>\n\t<Table width=800><\/p>\n<tr><\/p>\n<td id=\"hiddenZone\"><\/td>\n<p>\n\t\t<\/tr>\n<p><\/p>\n<tr><\/p>\n<td id=\"newZone\"><\/td>\n<p>\n\t\t<\/tr>\n<p><\/p>\n<tr><\/p>\n<td>\ub9d0 \uac2f\uc218  <br \/>\n\t\t\t\t<input type=text name='hCount' value=5 size=3> \n\t\t\t<\/td>\n<p>\n\t\t<\/tr>\n<p><\/p>\n<tr><\/p>\n<td>\ucd08\uae30\uc18d\ub3c4  <br \/>\n\t\t\t\t<input type=radio name='speedD' value=\"1\" checked> 1 <br \/>\n\t\t\t\t<input type=radio name='speedD' value=\"2\"> 2<br \/>\n\t\t\t\t<input type=radio name='speedD' value=\"3\"> 3 \n\t\t\t<\/td>\n<p>\n\t\t<\/tr>\n<p><\/p>\n<tr><\/p>\n<td>\n\t\t\t\t<input type=button value=\"Setting\" onClick=\"setHiddenTag();\"><br \/>\n\t\t\t\t<input type=button value=\"Start\" onClick=\"startHorse();\"><br \/>\n\t\t\t\t<input type=button value=\"\ucd08\uae30\ud654\" onClick=\"reStartGame();\">\n\t\t\t<\/td>\n<p>\n\t\t<\/tr>\n<p>\n\t<\/Table><br \/>\n<\/BODY><br \/>\n<\/HTML><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Script Game ::: Race ::: \ub9d0 \uac2f\uc218 \ucd08\uae30\uc18d\ub3c4 1 2 3<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-1421","post","type-post","status-publish","format-standard","hentry","category-papa-php"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1421"}],"version-history":[{"count":0,"href":"https:\/\/jblove.net\/index.php?rest_route=\/wp\/v2\/posts\/1421\/revisions"}],"wp:attachment":[{"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jblove.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}