ํƒœ๊ทธ ๋ณด๊ด€๋ฌผ: whitespace

whitespace

๊ทธ๋ฆผ๊ณผ ์ ‘์ง€ ๋ฐ”๊ฟˆ, 0x0A ๋˜๋Š”์ด ๋‘˜์˜ ์กฐํ•ฉ)์ž…๋‹ˆ๋‹ค. ์ค„ ๋ฐ”๊ฟˆ์„ ๋ฌด์‹œํ•˜๊ณ 

๊ทธ๋ฆผ๊ณผ ๋•…
์ถœ์ฒ˜ : Wikipedia

์ด ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐ ํ•˜๋ ค๋ฉด ์œ„ ์ด๋ฏธ์ง€ ์˜ ๊ทธ๋ฆผ๊ณผ ๋ฐฐ๊ฒฝ ๊ณผ ์œ ์‚ฌํ•œ ๋‘ ๊ฐœ์˜ ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์—ฌ ํ•˜๋‚˜๋Š” ์ธ์‡„ figureํ•˜๊ณ  ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ์ธ์‡„ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค ground. ๊ตฌ์ฒด์ ์œผ๋กœ :

  1. ์ž…๋ ฅ์„๋ฐ›์ง€ ์•Š๊ณ  ๋ฌธ์ž์—ด์„ ์ธ์‡„ํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹ญ์‹œ์˜ค figure. ํ”„๋กœ๊ทธ๋žจ์—์„œ ํ—ˆ์šฉ๋˜๋Š” ๊ณต๋ฐฑ ๋ฌธ์ž ๋Š” ๊ณต๋ฐฑ (์ฝ”๋“œ ํฌ์ธํŠธ 0x20)๊ณผ ์ค„ ๋ฐ”๊ฟˆ (์บ๋ฆฌ์ง€ ๋ฆฌํ„ด, 0x0D, ์ค„ ๋ฐ”๊ฟˆ, 0x0A ๋˜๋Š”์ด ๋‘˜์˜ ์กฐํ•ฉ)์ž…๋‹ˆ๋‹ค.
  2. ์ค„ ๋ฐ”๊ฟˆ์„ ๋ฌด์‹œํ•˜๊ณ  ๊ณต๋ฐฑ ๋ฌธ์ž (์ฝ”๋“œ ํฌ์ธํŠธ 0x20)์™€ ๊ณต๋ฐฑ์ด ์•„๋‹Œ ๋ฌธ์ž์˜ ์ˆ˜๋Š” ๊ฐ™์•„์•ผํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ด๊ฒƒ์€ ์œ ํšจํ•œ ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค (๊ฐ€์„ค โ€‹โ€‹์  ์–ธ์–ด๋กœ).

    ab c
       d
    e f
    

    ์ฒซ ์ค„์—๋Š” ํ›„ํ–‰ ๊ณต๋ฐฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  3. n ๋ฒˆ์งธ ๊ณต๋ฐฑ ๋ฌธ์ž๋ฅผ ๊ณต๋ฐฑ์ด ์•„๋‹Œ n ๋ฒˆ์งธ ๋ฌธ์ž๋กœ ๋ฐ”๊พธ๋ฉด ํ”„๋กœ๊ทธ๋žจ์ด ground๋Œ€์‹  ์ธ์‡„๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์œ„์˜ ์˜ˆ์—์„œ ํ”„๋กœ๊ทธ๋žจ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

      a b
    cde
     f
    

    ๋‘ ๋ฒˆ์งธ์™€ ์„ธ ๋ฒˆ์งธ ์ค„์—๋Š” ํ›„ํ–‰ ๊ณต๋ฐฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์–‘์ชฝ ๊ทธ๋ฆผ ๊ณผ ์ ‘์ง€ ์†”๋ฃจ์…˜์€ STDOUT๋กœ ์ธ์‡„ ๊ฐ™์€ ์–ธ์–ด๋กœ ์ „์ฒด ํ”„๋กœ๊ทธ๋žจ์ด์–ด์•ผํ•œ๋‹ค. ๋‘ ๊ฒฝ์šฐ ๋ชจ๋‘ ํ•˜๋‚˜์˜ ์„ ํƒ์  ํ›„ํ–‰ ์ค„ ๋ฐ”๊ฟˆ์„ ์ธ์‡„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. STDOUT์ด ์˜ฌ๋ฐ”๋ฅธ ํ•œ STDERR์— ์›ํ•˜๋Š” ๊ฒƒ์„ ์ถœ๋ ฅ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ชจ๋“  ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์ด๋Ÿฌํ•œ ํ—ˆ์  ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๊ธˆ์ง€๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๊ฒƒ์€ ์ด๋ฏ€๋กœ ๋ฐ”์ดํŠธ ๋‹จ์œ„๋กœ ์ธก์ • ๋œ ๊ฐ€์žฅ ์งง์€ ์œ ํšจํ•œ ๋‹ต๋ณ€์ด ์ด๊น๋‹ˆ๋‹ค.

๋„์šฐ๋ฏธ ์Šคํฌ๋ฆฝํŠธ

์ด CJam ์Šคํฌ๋ฆฝํŠธ ๋ฅผ ์‚ฌ์šฉ ํ•˜์—ฌ ๊ทธ๋ฆผ ๊ณผ ์ง€๋ฉด ํ”„๋กœ๊ทธ๋žจ ์‚ฌ์ด๋ฅผ ๋ณ€ํ™˜ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค . ๋‘˜ ์ค‘ ํ•˜๋‚˜๋ฅผ ์ž…๋ ฅ ํ•„๋“œ์— ๋ถ™์—ฌ ๋„ฃ๊ธฐ ๋งŒํ•˜๋ฉด ํ”„๋กœ๊ทธ๋žจ์ด ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ๊ณต๊ฐ„ ์ˆ˜์™€ ๋น„ ๊ณต๋ฐฑ ์ˆ˜๊ฐ€ ์ผ์น˜ํ•˜์ง€ ์•Š๋Š”์ง€ ์•Œ๋ ค์ค๋‹ˆ๋‹ค.

๋ฆฌ๋” ๋ณด๋“œ

function answersUrl(a){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+a+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(a,b){return"http://api.stackexchange.com/2.2/answers/"+b.join(";")+"/comments?page="+a+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(a){answers.push.apply(answers,a.items),answers_hash=[],answer_ids=[],a.items.forEach(function(a){a.comments=[];var b=+a.share_link.match(/\d+/);answer_ids.push(b),answers_hash[b]=a}),a.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(a){a.items.forEach(function(a){a.owner.user_id===OVERRIDE_USER&&answers_hash[a.post_id].comments.push(a)}),a.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(a){return a.owner.display_name}function process(){var a=[];answers.forEach(function(b){var c=b.body;b.comments.forEach(function(a){OVERRIDE_REG.test(a.body)&&(c="<h1>"+a.body.replace(OVERRIDE_REG,"")+"</h1>")});var d=c.match(SCORE_REG);d?a.push({user:getAuthorName(b),size:+d[2],language:d[1],link:b.share_link}):console.log(c)}),a.sort(function(a,b){var c=a.size,d=b.size;return c-d});var b={},c=1,d=null,e=1;a.forEach(function(a){a.size!=d&&(e=c),d=a.size,++c;var f=jQuery("#answer-template").html();f=f.replace("{{PLACE}}",e+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link),f=jQuery(f),jQuery("#answers").append(f);var g=a.language;g=jQuery("<a>"+g+"</a>").text(),b[g]=b[g]||{lang:a.language,lang_raw:g,user:a.user,size:a.size,link:a.link}});var f=[];for(var g in b)b.hasOwnProperty(g)&&f.push(b[g]);f.sort(function(a,b){return a.lang_raw.toLowerCase()>b.lang_raw.toLowerCase()?1:a.lang_raw.toLowerCase()<b.lang_raw.toLowerCase()?-1:0});for(var h=0;h<f.length;++h){var i=jQuery("#language-template").html(),g=f[h];i=i.replace("{{LANGUAGE}}",g.lang).replace("{{NAME}}",g.user).replace("{{SIZE}}",g.size).replace("{{LINK}}",g.link),i=jQuery(i),jQuery("#languages").append(i)}}var QUESTION_ID=101275,ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",OVERRIDE_USER=8478,answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:350px;float:left}table thead{font-weight:700}table td{padding:5px}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"><div id="language-list"> <h2>Shortest Solution by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table></div><div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table></div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody></table><table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody></table>


๋‹ต๋ณ€

์ ค๋ฆฌ , 20 ๋ฐ”์ดํŠธ

๊ทธ๋ฆผ

โ€œยฆฤ ศฎโ€œยฉแปฅdยป แน‚

9 ๊ฐœ์˜ ํ›„ํ–‰ ๊ณต๋ฐฑ. ์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

๋ฐ”๋‹ฅ

         โ€œ ยฆฤ ศฎโ€œยฉแปฅdยปแน‚

ํ›„ํ–‰ ๊ณต๋ฐฑ์ด ์—†์Šต๋‹ˆ๋‹ค. ์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

์ž‘๋™ ์›๋ฆฌ

์ฒซ์งธ, ๊ณต๋ฐฑ์€ ์›์ž๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ ๋ฌธ์ž์—ด ๋ฆฌํ„ฐ๋Ÿด ์™ธ๋ถ€์˜ ๊ณต๋ฐฑ ๋ฌธ์ž๋Š” ํ”„๋กœ๊ทธ๋žจ์— ์˜ํ–ฅ์„ ๋ฏธ์น˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋ฌธ์ž์—ด ๋ฆฌํ„ฐ๋Ÿด์€ Jelly์˜ ๋‚ด์žฅ ์‚ฌ์ „ ๊ธฐ๋ฐ˜ ๋ฌธ์ž์—ด ์••์ถ• ์„ ์‚ฌ์šฉํ•˜์—ฌ ์›ํ•˜๋Š” ๋‹จ์–ด๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์••์ถ• ๋œ ๋ฌธ์ž์—ด์˜ ๋ฌธ์ž๋กœ ์‹œ์ž‘ โ€œํ•˜์—ฌ, ๋‹จ๋ถ€ ยป, ๋ฐ ์‚ฌ์šฉ โ€œ๋ฌธ์ž์—ด์˜ ๋ฐฐ์—ด์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ๋‚ด๋ถ€์ .

์—์„œ๋Š” ๋„ ํ”„๋กœ๊ทธ๋žจ โ€œยฆฤ ศฎโ€œยฉแปฅdยป๋ฌธ์ž์—ด ์ˆ˜๋“ ์Œ ( โ€œ์ธ๋ฌผโ€, โ€œ๋ฐ”๋‹ฅโ€) ๋ฐ ์›์ž แน‚์„ ํƒํ•˜๋Š” ์‚ฌ์ „์ ์ธ ์ตœ์†Œ๊ฐ’, ์ฆ‰, โ€œ๊ทธ๋ฆผโ€ .

์ง€์ƒ ํ”„๋กœ๊ทธ๋žจ์—์„œ๋Š” ๋Œ€์‹  โ€œ ยฆฤ ศฎโ€œยฉแปฅdยป๋ฌธ์ž์—ด ์Œ ( โ€œlogicallyAbacsโ€, โ€œgroundโ€)์ด ์ƒ์„ฑ ๋ฉ๋‹ˆ๋‹ค. ์‚ฌ์ „ ์ตœ์†Œ๊ฐ’์€ ์ด์ œ โ€œgroundโ€ ์ด๋ฉฐ ์ด๋Š” แน‚์—„๋ฐ€ํžˆ ์„ ํƒ๋ฉ๋‹ˆ๋‹ค.

๋‘ ๊ฒฝ์šฐ ๋ชจ๋‘ ์ธํ„ฐํ”„๋ฆฌํ„ฐ๋Š” ๋งˆ์ง€๋ง‰ ๋ฐ˜ํ™˜ ๊ฐ’ (์ฆ‰, ์„ ํƒ๋œ ์ตœ์†Œ๊ฐ’)์„ STDOUT์— ์ž๋™์œผ๋กœ ์ธ์‡„ํ•ฉ๋‹ˆ๋‹ค.


๋‹ต๋ณ€

ํŒŒ์ด์ฌ 2, 53 ๋ฐ”์ดํŠธ

๊ต์ฒด ยท๋‘ ๋‹ต๋ณ€์˜ ๊ณต๊ฐ„ :

ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท
print'ยทยทยทยทยทยทfigureground'[6:12]#

์ธ์‡„ figureํ•ฉ๋‹ˆ๋‹ค.

print'figureground'[
ยทยทยทยทยทยท6:12]#ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท

์ธ์‡„ groundํ•ฉ๋‹ˆ๋‹ค.


๋‹ต๋ณ€

05AB1E , 15 14 ๋ฐ”์ดํŠธ

๊ทธ๋ฆผ

 'ล ร‚,'รญยถ

์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

๋ฐ”๋‹ฅ

'       ล ร‚,'รญยถ

์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

CP-1252 ์ธ์ฝ”๋”ฉ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค . ํ›„ํ–‰ ๊ณต๋ฐฑ์— ์œ ์˜ํ•˜์‹ญ์‹œ์˜ค. ์—์„œ ๊ทธ๋ฆผ ํ”„๋กœ๊ทธ๋žจ์ด ์˜ค๋ฅ˜์—†์ด ์ •์ƒ ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค. ๋‹ค์Œ ๋‹จ์–ด๋ฅผ ์••์ถ• ํ•ด์ œํ•ฉ๋‹ˆ๋‹ค.

'ล ร‚  ->  figure
'รญยถ  ->  ground

์‰ผํ‘œ๋Š” ํŒ์„ ์ธ์‡„ํ•˜๊ณ  figure์ค„ ๋ฐ”๊ฟˆ์œผ๋กœ ๋‹จ์–ด๋ฅผ ์ธ์‡„ํ•ฉ๋‹ˆ๋‹ค . ๋ฌด์–ธ๊ฐ€๊ฐ€ ์ธ์‡„๋˜์—ˆ์œผ๋ฏ€๋กœ ๋” ์ด์ƒ ์Šคํƒ ์ƒ๋‹จ์ด ์ธ์‡„๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์— ์ ‘์ง€ ํ”„๋กœ๊ทธ๋žจ,์ด ๊ฒฝ์šฐ์— ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค ๋ช‡ ๊ฐ€์ง€ ์˜ค๋ฅ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ๋ถ€๋ถ„ :

'<space>

์Šคํƒ ๋งจ ์œ„์— ๊ณต๋ฐฑ ๋ฌธ์ž๋ฅผ ๋„ฃ์Šต๋‹ˆ๋‹ค. ๋Š” ล ์ธ์ˆ˜์— ๋Œ€์‘ ๊ฐ–๋Š” ์Šคํƒ, ํšŒ์ „ 3 . ์Šคํƒ์— ์š”์†Œ๊ฐ€ ํ•˜๋‚˜๋งŒ ์žˆ๊ณ  ์ž…๋ ฅ์ด ์—†์œผ๋ฏ€๋กœ ์Šคํƒ์„ ์ง€์šฐ๋Š” ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์€ ร‚์Šคํƒ์˜ ์ƒ๋‹จ์„ ๋‘ ๊ฐˆ๋ž˜ ์žˆ์ง€๋งŒ, ์ด๊ฒƒ์€ ํšŒ์ „ ์—ฐ์‚ฐ์ž์™€ ๊ฐ™์€ ์Šคํ† ๋ฆฌ๋ฅผ ๊ฐ–๋Š”๋‹ค. ๋”ฐ๋ผ์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ,๋ช…๋ น์€ ์•„๋ฌด๊ฒƒ๋„ ์ธ์‡„ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ฆ‰, ํ”„๋กœ๊ทธ๋žจ์€ ์—ฌ์ „ํžˆ โ€‹โ€‹์Šคํƒ์˜ ๋งจ ์œ„์—์žˆ๋Š”์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค 'รญยถ. ๋กœ ๊ฒฐ๊ณผ ground.


๋‹ต๋ณ€

๋ง๋ง‰ , 31 ๋ฐ”์ดํŠธ

๊ทธ๋ฆผ:

|
๊ทธ๋ฆผ
 | ์ง€์ƒ
      

๋ฐ”๋‹ฅ:

 | ๊ทธ๋ฆผ

|
๋ฐ”๋‹ฅ

๊ทธ๋ฆผ ๊ณผ ์ ‘์ง€ . ๋‘ ํ”„๋กœ๊ทธ๋žจ ๋ชจ๋‘ ์œ ํšจํ•œ ๋„ํ˜• ๋˜๋Š” ์ง€์ƒ ํ”„๋กœ๊ทธ๋žจ์ด ๋˜๋ ค๋ฉด STDIN์„ ๋น„์›Œ ๋‘์–ด์•ผํ•ฉ๋‹ˆ๋‹ค.


๋‹ต๋ณ€

Pyth, 30 ๋ฐ”์ดํŠธ

๊ทธ๋ฆผ

"figure" "ground

14 ๊ฐœ์˜ ํ›„ํ–‰ ๊ณต๋ฐฑ.

ํ…Œ์ŠคํŠธ

๋ฐ”๋‹ฅ

ํ›„ํ–‰ ๊ณต๋ฐฑ์ด ์—†์Šต๋‹ˆ๋‹ค.

        "       figure""ground

ํ…Œ์ŠคํŠธ

์ž‘๋™ ์›๋ฆฌ

์˜คํžˆ๋ ค ์œ ์šฉํ•˜๊ฒŒ๋„ ๊ณต๋ฐฑ์€ Pyth์—์„œ ์ธ์‡„๋ฅผ ์–ต์ œํ•˜๋Š” ๋ฐ˜๋ฉด ๋ฌธ์ž์—ด ๋ฆฌํ„ฐ๋Ÿด์€ ๋‹ซํžˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. " ์ด ์€ ์•”์‹œ ์ ์œผ๋กœ ๋‹ซํž™๋‹ˆ๋‹ค.

์ œ ํ”„๋กœ๊ทธ๋žจ ๋”ฐ๋ผ์„œ ๋‘ ๋ฌธ์ž์—ด๋กœ ๊ตฌ์„ฑ "figure"ํ•˜๊ณ  "ground ". ์ฒซ ๋ฒˆ์งธ ๋ฌธ์ž์—ด์€ ์•”์‹œ ์ ์œผ๋กœ ์ธ์‡„๋˜๊ณ  ๋‘ ๋ฒˆ์งธ ๋ฌธ์ž์—ด์˜ ์ธ์‡„๋Š” ์–ต์ œ figure๋˜์–ด ์ธ์‡„๋ฉ๋‹ˆ๋‹ค.

๋‘๋ฒˆ์งธ ํ”„๋กœ๊ทธ๋žจ์€ ๋‘ ๊ฐœ์˜ ๋ฌธ์ž์—ด๋กœ ๊ตฌ์„ฑ " figure"ํ•˜๊ณ  "ground". ์ฒซ ๋ฒˆ์งธ์˜ ์ธ์‡„๋Š” ์–ต์ œ๋˜๊ณ  ๋‘ ๋ฒˆ์งธ์˜ ์ธ์‡„๋Š” ์•”์‹œ ์ ์œผ๋กœ ์ธ์‡„๋ฉ๋‹ˆ๋‹ค. ์ฆ‰, ground์ธ์‡„ ๋งŒ๋ฉ๋‹ˆ๋‹ค.


๋‹ต๋ณ€

MATL , 37 ๋ฐ”์ดํŠธ

์ฒซ ๋ฒˆ์งธ ํ”„๋กœ๊ทธ๋žจ

'figure'
%x'ground'

๊ฐ ์ค„์—๋Š” 9 ๊ฐœ์˜ ํ›„ํ–‰ ๊ณต๋ฐฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

๋‘ ๋ฒˆ์งธ ํ”„๋กœ๊ทธ๋žจ

    'figure'%
      x'ground'

์—ฌ๊ธฐ์—๋Š” ํ†ตํ–‰ ๊ณต๊ฐ„์ด ์—†์Šต๋‹ˆ๋‹ค.

์˜จ๋ผ์ธ์œผ๋กœ ์‚ฌ์šฉํ•ด๋ณด์‹ญ์‹œ์˜ค!

์„ค๋ช…

์ •๋ง ๋ฉ‹์ง„ ๊ฒƒ์€ ์—†์Šต๋‹ˆ๋‹ค โ€ฆ

  • ๋ฌธ ์‚ฌ์ด์˜ ๊ณต๋ฐฑ๊ณผ ์ค„ ๋ฐ”๊พธ๊ธฐ๋Š” MATL์— ์˜ํ•ด ๋ฌด์‹œ๋ฉ๋‹ˆ๋‹ค.
  • % ์ฃผ์„ ์ค„์ด๋ฉฐ ๋‚˜๋จธ์ง€ ์ค„์€ ๋ฌด์‹œํ•ฉ๋‹ˆ๋‹ค.
  • x ์Šคํƒ์˜ ์ƒ๋‹จ์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.
  • ์Šคํƒ์€ ํ”„๋กœ๊ทธ๋žจ ๋์—์„œ ์•”์‹œ ์ ์œผ๋กœ ์ธ์‡„๋ฉ๋‹ˆ๋‹ค.

๋‹ต๋ณ€

์ž๋ฐ”, 180 ๋ฐ”์ดํŠธ

.๊ณต๊ฐ„์œผ๋กœ ๊ต์ฒดํ•˜์‹ญ์‹œ์˜ค .

โ€œ๊ทธ๋ฆผโ€์„ ์ธ์‡„ํ•ฉ๋‹ˆ๋‹ค.

class
A{public
static
void
main(String[]a){System.out.println(
//"ground"
//
.....
........
......
....
...................................
..
........
..........
....
"figure");}}

โ€œ์ ‘์ง€โ€๋ฅผ ์ธ์‡„ํ•ฉ๋‹ˆ๋‹ค.

.....
........
......
....
...................................
..........
..
class
A{public
static
void
main(String[]a){System.out.println(
//
"ground"
//"figure"
);}}
............