C vs Perl

idlock의 이미지
2389
points
5
points

Original Fox Trot Comic using C code.

Standard Perl Statement

Perl one-liner

http://perl.hacker.freeservers.com/
* 언어 논쟁이야기가 절대~!!! 아님니다. 그냥 웃자고요 ^^

codebank의 이미지
21914
points

:D 만화 내용을 이해 못했었는데 짜여진 코드를 보고 이해를 했습니다.

0
points

:D 만화 내용을 이해 못했었는데 짜여진 코드를 보고 이해를 했습니다. :)
반성문을 저런식으로 처리해버리니... 대단한 유머감각이 아닐 수 없겠네요...
그나저나 저정도 어린아이가 저렇게 어려운(?) 코드를 작성한다는 것 자체가 두려울
따름입니다. 아~~~ 내자리가 위태로워보이는군요... :oops:

P.S. : 언어논쟁은 저도 싫어합니다. 웃을 수 있는 그림을 올려주셔서 고맙네요...

서지훈의 이미지
12625
points

ㅋㅋㅋ애교 * 500 ^^ <어떠한 역경에도 굴하지

0
points

ㅋㅋㅋ

애교 * 500 ^^

<어떠한 역경에도 굴하지 않는 '하양 지훈'>

익명 사용자의 이미지

첫번째 C 코드에는 \n 이 빠져있네요.실행해 보면 버그를 발견하려나

0
points

첫번째 C 코드에는 \n 이 빠져있네요.
실행해 보면 버그를 발견하려나.. :)

개행문자는 없어도 되지않나요?>

0
points

K.J.Lee

opt의 이미지
1137
points

멋지군요....

1
point

print "good job -_-)=b \n"x500;

[b]#!/usr/bin/perl [/b]이 빠진거 아닌가요?(절

0
points

#!/usr/bin/perl 이 빠진거 아닌가요?

(절대 꼬투리 잡는거 아닙니다.
혹시 제가 모르는 #!/usr/bin/perl 을 안쓰고 사용할 수 있는 방법이 있나 해서요?)

서지훈의 이미지
12625
points

[quote="santana"][b]#!/usr/bin/perl [/b]

0
points

santana 씀:
#!/usr/bin/perl 이 빠진거 아닌가요?

(절대 꼬투리 잡는거 아닙니다.
혹시 제가 모르는 #!/usr/bin/perl 을 안쓰고 사용할 수 있는 방법이 있나 해서요?)


뭐 잘 아시겠지만...
혹시나 해서 적습니다.
$ perl test.perl

<어떠한 역경에도 굴하지 않는 '하양 지훈'>

neocoin의 이미지
1062
points

using python

0
points

Using Java

public class Main {
	public static void main(String[] args) {
		for ( int i = 0; i<500; i++)
			System.out.println("I will not throw paper airplanes in class");
	}
}

Standard Python Statement

for i in range(1,10):
	print "I will not throw paper airplanes in class" 

Python one-liner
print "I will not throw paper airplanes in class\n" * 500

지금 보니...

1
point

수많은 소스들에서 마침표 '.'가 빠져 있네요~

h2h1995의 이미지
1066
points

[b]Using Tcl[/b][code:1]for&#123;set i

0
points

Using Tcl

for{set i 0}{$i < 500}{incr i} {
  puts "I will not throw paper airplanes in class\n"
}

opt의 이미지
1137
points

[quote="santana"][b]#!/usr/bin/perl [/b]

0
points

santana 씀:
#!/usr/bin/perl 이 빠진거 아닌가요?

(절대 꼬투리 잡는거 아닙니다.
혹시 제가 모르는 #!/usr/bin/perl 을 안쓰고 사용할 수 있는 방법이 있나 해서요?)

oneliner 이니까 전체 구문을 다 살리면.... 이렇게 했겠지요.

perl -e 'print "...snip..."x500';

kall의 이미지
5962
points

혹시나 했는데 역시나.. 언어별로 하나둘 올라오기 시작하는 군요

0
points

혹시나 했는데 역시나..

언어별로 하나둘 올라오기 시작하는 군요 ^^;

idlock의 이미지
2389
points

저도 이걸 노렸죠 -.-

0
points

저도 이렇게 리플리 달리길 바랫답니다. -.-..
[이럼 않올라올라나 :twisted: ]

누가 C++ 버전 리플을 달았네요. -.- 대단하다..

 #include <iostream>
  struct C {
     C() { std::cout << "I will not throw paper airplanes in class\n"; }
  } c[500];
  int main() { return 0; }

nohmad의 이미지
3168
points

ruby[code:1]500.times &#123; pu

0
points

ruby

500.times {
    puts "I will not throw paper airplanes in class\n"
}

bh의 이미지
4520
points

아.. 저 그림에 나오는 꼬마,,과연 몇살일까나..난 저나이때 믈

0
points

아.. 저 그림에 나오는 꼬마,,
과연 몇살일까나..
난 저나이때 믈 했는지..
부러버,, 우엉~

ai의 이미지
4530
points

흔히 perl 을 말할 때[quote]TMTOWTDI, or `the

1
point

흔히 perl 을 말할 때

인용:
TMTOWTDI, or `theres more than one way to do it'

이라고 하는데, 가끔은 이런 생각이 들 때도 있습니다.
인용:
CIALAMAYW, or `cram in a line as much as you want'

아. 물론 CIALAMAYW 이건 없는 말이지만요. :)

alfalf의 이미지
3454
points

SH Script

0
points

SH Script

for i in `seq 500`; do echo "I will not throw paper airplanes in class"; done

sh.의 이미지
3804
points

php[code:1]$ php -r 'while &#40;$i++

0
points

php

$ php -r 'while ($i++ <= 500) echo "I will not throw paper airplanes in class\n";'

bh의 이미지
4520
points

[quote="seearomi"]첫번째 C 코드에는 \n 이 빠져있네요.

0
points

seearomi 씀:
첫번째 C 코드에는 \n 이 빠져있네요.
실행해 보면 버그를 발견하려나.. :)

개행문자 패치

--- for_3.c.orig        Fri Dec  5 15:20:06 2003
+++ for_3.c     Fri Dec  5 15:23:12 2003
@@ -5,7 +5,7 @@
        int count;

        for(count=1;count<=500;count++)
-               printf("I will not...");
+               printf("I will not...\n");

        return 0;
 }

썰렁~

확장자를 pl로 하셨다면..

0
points

santana 씀:
#!/usr/bin/perl 이 빠진거 아닌가요?

(절대 꼬투리 잡는거 아닙니다.
혹시 제가 모르는 #!/usr/bin/perl 을 안쓰고 사용할 수 있는 방법이 있나 해서요?)

echo ":PERL:E::pl::/usr/bin/perl:" > /proc/sys/fs/binfmt_misc/register 하심 되겠죠.. 물론 mount -t binfmt_misc none /proc/sys/fs/binfmt_misc 해 주시고..

php 두번째-_-[code:1]#!/usr/local/php

0
points

php 두번째-_-

#!/usr/local/php/bin/php -q
<? echo str_repeat("I will not throw paper airplanes in class\n",500); ?>

[code:1]$ yes &quot;I will not throw p

0
points

$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

ㅋㅋㅋ

0
points

CTRL + C 만 잘누르면..

cdpark의 이미지
6852
points

[quote="yamainu"][code:1]$ yes &quot;I

1
point

yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

이렇게 고치면 되죠. :)

yes "I will not throw paper airplanes in class" | head -500

bh의 이미지
4520
points

[quote="yamainu"][code:1]$ yes &quot;I

0
points

yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

yOU wIN!
-_-;;;;;;;

bh의 이미지
4520
points

[quote="cdpark"][quote="yamainu"][code:1

0
points

cdpark 씀:
yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

이렇게 고치면 되죠. :)

yes "I will not throw paper airplanes in class" | head -500

머찌다는 말 이외에 더 좋은 말이 안떠오르네요.. -_-

sh.의 이미지
3804
points

[quote="yamainu"][code:1]$ yes &quot;I

0
points

yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

ㅋㅋㅋ
반항한다구 선생님한테 맞을거에요

gilchris의 이미지
2327
points

[quote="yamainu"][code:1]$ yes &quot;I

0
points

yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

아... yes는 이렇게 쓰는 거군요. 오늘 첨 알았다는.. -_-;;

whitelazy의 이미지
3484
points

yes............ 무섭군요......직접 해보고 나서야 이

0
points

yes............ 무섭군요......
직접 해보고 나서야 이해했다는......;;
암생각없이 yes 만 달랑 쳤더니만 =_=;;;;;;

galien의 이미지
6674
points

[quote="cdpark"][quote="yamainu"][code:1

0
points

cdpark 씀:
yamainu 씀:
$ yes "I will not throw paper airplanes in class"

이건 좀 너무하죠...

이렇게 고치면 되죠. :)

yes "I will not throw paper airplanes in class" | head -500

역시 hacker 레벨이 되면 이런 멋진 코드가 나오는 군요.

나를 감동시킨 코드에 등록하겠습니다. ^^

저는 실은 크론에다 echo걸어놓고 500일 기다릴라구 했습니다만, 그랬다간 선생님한테 혼나겠군요. 다른 이유로 .... ^^
(하긴 꼭 하루에 한번 돌게 하지 않아도 되겠습니다만 ^^)

최종호의 이미지
1675
points

[quote="h2h1995"][b]Using Tcl[/b][code

0
points

h2h1995 씀:
Using Tcl
for{set i 0}{$i < 500}{incr i} {
  puts "I will not throw paper airplanes in class\n"
}

뒤의 \n 은 빼야하지 않을까요? ^^

패치 만드신 분, 원츄 -_-)b정말 웃겼습니다.이 쓰레드

0
points

패치 만드신 분, 원츄 -_-)b

정말 웃겼습니다.

이 쓰레드는 KLDP 명예의 전당 같은 곳에 올려야 하지 않을까 생각되네요 ㅋㅋ

반성문이니까.. 콘솔보다는.. 웹 페이지에 띠우는게 보기 좋을 듯 싶네요

0
points

반성문이니까.. 콘솔보다는.. 웹 페이지에 띠우는게 보기 좋을 듯 싶네요.. ^^

CGI

#include <stdio.h>

int main()
{
  int i;

  printf("Content-Type: text/html\r\n\r\n");

  for (i = 0; i < 500; i++)
    printf("I will not throw paper airplanes in class<BR>");

  return 0;
}

nohmad의 이미지
3168
points

JavaScript:[code:1]&lt;SCRIPT type=&qu

0
points

JavaScript:

<SCRIPT type="text/javascript" language="JavaScript">
<!--
for (var i=0; i < 500; i++)
    alert("I will not throw paper airplanes in class.");
//-->
</SCRIPT>

이렇게 하면 엔터를 500번 눌러야 하므로
반성문 검사 하시는 분을 골탕먹이는 게 될 수도 있겠네요.

전혀 반성하는 자의 자세라고 볼 수 없는...

pynoos의 이미지
11620
points

그냥 재미로..Makefile and echo:[code:1]al

1
point

그냥 재미로..
Makefile and echo:

all:
        @echo "I will not throw paper airplanes in class." 1>&2
        @if test $$MAKELEVEL -lt 500; then make 1>/dev/null; fi

Makefile인관계로 두번째 세번째 줄은 맨 앞이 tab이어야..

세벌의 이미지
5504
points

[quote="nohmad"]JavaScript:[code:1]&lt

0
points

nohmad 씀:
JavaScript:
<SCRIPT type="text/javascript" language="JavaScript">
<!--
for (var i=0; i < 500; i++)
    alert("I will not throw paper airplanes in class.");
//-->
</SCRIPT>

이렇게 하면 엔터를 500번 눌러야 하므로
반성문 검사 하시는 분을 골탕먹이는 게 될 수도 있겠네요.

전혀 반성하는 자의 자세라고 볼 수 없는...

<script>
for(var i=0; i<500; i++)
  document.write("I will not throw paper airplanes in class.\n");
</script>

이렇게 하면 안 혼나려나?

이 thread를 명예의 전당에!

0
points

:shock:

올려 보존하심이 좋을 줄로 아뢰오.

M.W.Park의 이미지
7343
points

으음... 안 올라온 것을 하려고 하니... 윈도밖에 할게 없는듯..

0
points

@echo off
for /l %i in (1,1,500) do echo I will not throw paper airplanes in class
@echo on

앞뒤에 @echo 를 안 넣는 방법은 없을지... :twisted:

cdpark의 이미지
6852
points

[code:1]500iI will not throw paper airpl

0
points

500iI will not throw paper airplanes in class
<ESC>

:evil:

굳이 윈도라고 한다면...

0
points

#include <windows.h>

int main( void )
{
  int i ;
  for ( i = 0 ; i < 500 ; i ++ )
    MessageBox( 0, "I will not throw paper airplanes in class", "", MB_OK ) ;
  return 0 ;
}

이정도면 선생님이 용서해주실지도 모르겠는데...

#include <windows.h>
#include <processs.h>

void thread_proc( void *ptr )
{
  MessageBox( 0, "I will not throw paper airplanes in class", "", MB_OK ) ;
}

int main( void )
{
  int i ;
  for ( i = 0 ; i < 500 ; i ++ )
    _beignthread( thread_proc, 0, 0 ) ;
  return 0 ;
}

컴파일 될라나... -.-;;
[/code]

maylinux의 이미지
6265
points

다른건 예상을 했는데..yes 를 이용한건 전혀 예상못했습니다

0
points

다른건 예상을 했는데..

yes 를 이용한건 전혀 예상못했습니다 :o

정말 멋지고, 강력합니다

Re: 으음... 안 올라온 것을 하려고 하니... 윈도밖에 할게 없는

0
points

M.W.Park 씀:
앞뒤에 @echo 를 안 넣는 방법은 없을지... :twisted:

@for /l %i in (1,1,500) do @echo I will not throw paper airplanes in class

XP에서 테스트 했습니다. 그 이전버전은 어떻게 될지 모르겠네요. :)

아시는 분은, 아래 언어 버전을 만들어 보심이..(n)ML, Ha

0
points

아시는 분은, 아래 언어 버전을 만들어 보심이..

(n)ML, Haskel, c#, FORTRAN, COBOL,
LISP, Prolog, Pascal, Smalltalk, Scheme ...

fortran90 버전;;히힛~ :D [code:1]pr

0
points

fortran90 버전;;
히힛~ :D

program sorry
	implicit none
	integer :: i
	
	do i=1,500
		write(*,*) "I will not throw paper airplanes in class"
	end do
end program sorry

gurugio의 이미지
6805
points

어셈

0
points

str db "I will not throw paper airplanes in class",0ah, 0ch, 0

les esi, str
mov al, 02h
mov ecx, sizeof str

LABEL
push eax
mov dl, [esi]
int 21h
pop eax
loop LABEL

아.. 역시 어셈은 아무리 해도 폼이 안나요... cry
도스 인터럽트를 썼다고 뭐라하기 없기에요~ oops

gurugio의 이미지
6805
points

nasm 버전

0
points

str db "I will not throw paper airplanes in class",0ah, 0ch, 0

les esi, str

mov ecx, 500
LABEL
push esi
call printf
pop eax
loop LABEL

리눅스 시스템 콜을 써보니까 좀더 간단해 지네요..

ageldama의 이미지
1593
points

commonlisp...

0
points

(loop for I from 1 to 500 by 1 do 
 (format t "I will not throw paper airplanes in class~%"))

alfalf의 이미지
3454
points

기억 나는대로..

0
points

10분 공부한 ALGOL

BEGIN
INTEGER i;
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:41];
REPLACE E BY "I will not throw paper airplanes in class";
FOR i:=1 STEP 1 UNTIL 500 DO
  BEGIN
  WHILE TRUE DO
    BEGIN
    WRITE (F, *, E);
    END;
  END;
END.

BASIC

10 FOR i = 1 TO 500 
20 PRINT "I will not throw paper airplanes in class" 
30 NEXT i

Clipper(DBASE 류)

FOR i := 1 TO 500 
? "I will not throw paper airplanes in class" 
NEXT 

윈도우를 쓰시는 선생님을 위해

0
points

메모장에 띄우기...

WSH Version

Set WshShell=WScript.CreateObject("Wscript.Shell")
WshShell.Run "notepad"
WScript.sleep 500

For i=0 To 499
    WshShell.SendKeys "I will not throw paper airplanes in class"
    WScript.sleep 20
    WshShell.SendKeys "{Enter}"
    WScript.sleep 20
Next

WScript.sleep 3000
WshShell.SendKeys "%{F4}"
WScript.sleep 100
WshShell.SendKeys "N"
WScript.sleep 100
Set WshShell = Nothing

idlock의 이미지
2389
points

Pascal 버전

0
points

Pascal:

하도 오래되서 맞는지 모르겟지만 -.-

Unit PrintBlackborad;

var I:Integer;

begin
    for I := 1 to 500 do  writeln("I will not throw paper airplanes in class");

end.

dsh의 이미지
1440
points

Cobol[code:1]PERFORM VARYING II FROM

0
points

Cobol

PERFORM VARYING II FROM 1 BY 1 UNTIL II > 500
  DISPLAY "I will not throw paper airplanes in class"
END-PERFORM

없길래.. :)

-_-;;

0
points

$ wget -qO - "http://some.host.org/tmp/test.php"

cedar의 이미지
1258
points

C++에서 template metaprogramming 사용하는 버전

0
points

일반적인 C++ 소스는 앞에 나와 있어서,
저는 템플릿 메타프로그래밍을 사용하는 버전을 만들었습니다.
쓸데 없이(?) 복잡하지만, 이런 것도 가능하다는 것도 알아두시길... 8)

#include <iostream>

template<int i>
struct loop{
    static void body(){
      loop<i-1>::body();
      loop<0>::body();
    }
};

struct loop<0>{
    static void body(){
      std::cout << "I will not throw paper airplanes in class\n";
    }
};

int main()
{
    loop<500>::body();
    return 0;
}

익명 사용자의 이미지

loop<499>가 맞을 것 같군요.

0
points

loop<1>이 2번 출력하기 때문에...

[b]Clean[/b] 간단히 Start함수식의 평가를 이용해서[

0
points

Clean
간단히 Start함수식의 평가를 이용해서

Start :: {#Char}
Start = abort (fun 1) // 인용부호의 출력을 막기위해  abort ^^;
where
	fun :: Int -> {#Char}
	fun n
		| n <= 500	= "I will not throw paper airplanes in class.\n" +++ fun (n+1)
				       = ""

Ada95

with Ada.Text_IO; use Ada.Text_IO;
procedure Fun is
begin
    for I in 1..500 loop
        Put_Line("I will not throw paper airplanes in class.");
    end loop;
end Fun;

cedar의 이미지
1258
points

내친 김에... C++ STL 버전

0
points

//---------------------------------------------------------------------------
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
//---------------------------------------------------------------------------
using namespace std;

int main()
{
	vector<string> messages(500, "I will not throw paper airplanes in class.");
	copy(messages.begin(), messages.end(), ostream_iterator<string>(cout, "\n"));
	return 0;
}
//---------------------------------------------------------------------------

metaprogramming 버전보다는 확실히 느리군요.
위의 메타프로그래밍을 사용한 버전은 스크롤 속도를 느낄 수 없을 정도로
순간적으로 표시됩니다.

cinsk의 이미지
12040
points

emacs lisp[code:1]&#40;defun reflect

1
point

emacs lisp

(defun reflection ()
  (let ((i 0))
    (while (< i 500)
      (princ "I will not throw paper airplanes in class.\n")
      (setq i (1+ i)))))

(reflection)

실행은

emacs -batch -l 파일이름.el

또는

*scratch* buffer에서 (defun ...) 입력후 C-j, (reflection) 입력 후 C-j

cinsk의 이미지
12040
points

Scheme (for guile)[code:1]#!/usr/bin

1
point

Scheme (for guile)

#!/usr/bin/guile
!#
(define reflection
  (lambda ()
    (let ((i 0))
      (while (< (i 500)
        (display "I will not throw paper airplanes in class.\n")
        (set! i (1+ i))))))
(reflection)

yui의 이미지
1085
points

nML버전

0
points

ktaekin 씀:
아시는 분은, 아래 언어 버전을 만들어 보심이..

(n)ML, Haskel, c#, FORTRAN, COBOL,
LISP, Prolog, Pascal, Smalltalk, Scheme ...

nML

fun 반성문(0) = print_string ""
  | 반성문(n) = print_string "I will not throw paper airplanes in class\n"; 반성문(n-1)

ironiris의 이미지
6149
points

반성문을 엄청 많이(한.. 수십억정도??) 적으라고 한다면 저는 asm

0
points

반성문을 엄청 많이(한.. 수십억정도??) 적으라고 한다면 저는 asm 버전으로 작성하겠습니다. 그래야 일찍 집에 갈것 아니겠어요? ^^;

alfalf의 이미지
3454
points

이거 혹시...

0
points

ktaekin 씀:
아시는 분은, 아래 언어 버전을 만들어 보심이..

(n)ML, Haskel, c#, FORTRAN, COBOL,
LISP, Prolog, Pascal, Smalltalk, Scheme ...

이거 혹시...

여러가지 언어로 반성문 쓰는게 idlock님과 ktaekin님의 숙제 아니었을까요?

:lol:

h2h1995의 이미지
1066
points

[quote="최종호"][quote="h2h1995"][b]Using T

0
points

최종호 씀:
h2h1995 씀:
Using Tcl
for{set i 0}{$i < 500}{incr i} {
  puts "I will not throw paper airplanes in class\n"
}

뒤의 \n 은 빼야하지 않을까요? ^^

오메~.. 이런 실수가..
가끔 Tcl로 프로그래밍시.. C에서 하던 버릇댐시.. 넣곤합니다..
안넣어도 newline 자동으로 되는데.. ^^

neocoin의 이미지
1062
points

Using Smalltalk

0
points

http://squeak.org/

Using Squeak (Smalltalk-80 implementation)

500 timesRepeat: 
	[Transcript show:'I will not throw paper airplanes in class';cr]

neocoin의 이미지
1062
points

Using 국회의원

1
point

Using 국회의원
김비서 'I will not throw paper airplanes in class' 500줄 찍어오게.

ps.
Using 일부 국회의원
김비서 청와대 가서 'I will not throw paper airplanes in class' 500줄 찍어오게. 안그럼 단식이야.

nohmad의 이미지
3168
points

악플러 or 도배맨:[code:1]I will not throw pa

0
points

악플러 or 도배맨:
I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class............ (중략) ............... I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class. I will not throw paper airplanes in class.

맹고이의 이미지
5215
points

[quote]★(광고)반성문을 무료로 써드립니다★반성문 쓰느라 많

0
points

인용:
★(광고)반성문을 무료로 써드립니다★

반성문 쓰느라 많이 힘드시죠?
저희 사이트에 가입만 하시면
반성문을 무료로 써드립니다.
지금 당장 아무일이 없으시더라도 사람 일은 모르는 일...
가입해 두시면 유용하게 쓰일 날이 있을지도 모르죠.
이미 많은 분들이 너무 편하고 그럴 듯 하다고 만족감을 표시하셨습니다.
오셔서 직접 확인해 주세요~

마지막으로 싸이트 성격에 맞지 않는 글을 올렸다면 죄송하게 생각합니다.
넓은 아량으로 이해해 주시기 바라며, 삭제 시 암호는 0000 입니다.
게시판에 글이 등록되는 것을 원치 않으신다면 위 메일 주소로 싸이트의 주소를 보내 주세요.

monpetit의 이미지
7792
points

또다른 Scheme 버전입니다. 재귀적으로 구현해야 아무래도 scheme

1
point

또다른 Scheme 버전입니다. 재귀적으로 구현해야 아무래도 scheme 분위기가... :)

(letrec ((reflection 
          (lambda (msg n)
            (if (> n 0)
                (begin (display msg)
                       (reflection msg (- n 1)))))))
  (reflection "I will not throw paper airplanes in class.\n" 500))

Re: Pascal 버전

0
points

idlock 씀:
Pascal:

하도 오래되서 맞는지 모르겟지만 -.-

Unit PrintBlackborad;

var I:Integer;

begin
    for I := 1 to 500 do  writeln("I will not throw paper airplanes in class");

end.

writeln('I will not throw paper airplanes in class');
가 되어야 하지 않을까요. 파스칼에서는 작은 따옴표로 스트링을 나타내는 것 같았던.... ;; ( 가물가물 )

전에 나온 C++ 버전들에게서 영감을 얻어 하나..[code:1]

0
points

전에 나온 C++ 버전들에게서 영감을 얻어 하나..

#include <iostream>
int main() { return 0; }

template<int i>
struct C : C<i-1> {
    C() { std::cout << "I will not throw paper airplanes in class\n"; }
};
template<> struct C<0> {};
C<500> c;

pynoos의 이미지
11620
points

awk

1
point

아직도 안나온거 같애서...

awk:

$ awk 'BEGIN { for( i=0; i<500; i++ ) print "I will not throw paper airplanes in class" }'

pynoos의 이미지
11620
points

pre-ansi c

1
point

pre-ansi C:

main(_)
{
        _ <= 500 && 
        printf("I will not throw paper airplanes in class\n", _ ) && 
        main (_+1);
}

재미로....

이한길의 이미지
7720
points

Re: nML버전

0
points

yui 씀:
ktaekin 씀:
아시는 분은, 아래 언어 버전을 만들어 보심이..

(n)ML, Haskel, c#, FORTRAN, COBOL,
LISP, Prolog, Pascal, Smalltalk, Scheme ...

nML

fun 반성문(0) = print_string ""
  | 반성문(n) = print_string "I will not throw paper airplanes in class\n"; 반성문(n-1)

ML코드를 보니 반갑네요...
예전에 시험문제에..

fun reverse(x) = nil
  | reverse(x::xs) = reverse(xs)@[x];

fun reverse(x) = if x=nill then nill else tl(x)@[hd(x)];

둘 사이의 차이점에 대해 쓰라던 기억이... ㅎㅎ

어디 까지 갈까요 ㅡㅡaI will not throw paper

0
points

어디 까지 갈까요 ㅡㅡa

I will not throw paper airplanes in class\n

블럭지정후 ctrl+c -> ctrl+v

다음은 선생이 되따거 할때까지? ㅡㅡa

리눅스는

블럭지정후 shift + insert ㅡㅡa

원츄~!

idlock의 이미지
2389
points

Re: Pascal 버전

0
points

deisys 씀:
idlock 씀:
Pascal:

하도 오래되서 맞는지 모르겟지만 -.-

Unit PrintBlackborad;

var I:Integer;

begin
    for I := 1 to 500 do  writeln("I will not throw paper airplanes in class");

end.

writeln('I will not throw paper airplanes in class');
가 되어야 하지 않을까요. 파스칼에서는 작은 따옴표로 스트링을 나타내는 것 같았던.... ;; ( 가물가물 )

맞네요 헉.. 그리고 Unit 이나고 program인데 -.-;.. 자꾸 보니깐 조금씩 생각이 나는군요.

program PrintBlackborad;

var I:Integer;

begin
    for I := 1 to 500 do  writeln('I will not throw paper airplanes in class');

end.

likesam의 이미지

Re: Pascal 버전

0
points

pacal 정확하게는 Delphi에서 실행가능한 형태입니다.^^;

program Project1;
{$APPTYPE CONSOLE}
var i : integer;
begin
  for i := 1 to 500 do
    writeln ('I will not throw paper airplanes in class')
end.

위에서 {$APPTYPE CONSOLE}을 빼시면 에러가 나죠 ^^;

KLDP 아이디가 없는 제 동생이 먼 땅에서 prolog 코드를 제보해주

0
points

KLDP 아이디가 없는 제 동생이 먼 땅에서 prolog 코드를 제보해주었습니다. :D

sorry :- sorry(500).
sorry(0).
sorry(N) :-
write('I will not throw paper airplanes in class'), nl,
N2 is N-1,
sorry(N2).

Haskell로는 대략 이렇게...sorry :: Int -&gt

0
points

Haskell로는 대략 이렇게...

sorry :: Int -> IO()
sorry count = if count >=0
then do putStrLn "I will not throw paper airplanes in class"
let count2 = count -1;
int do sorry count2

앗 indentation 문제는 그냥 넘어가주시길