1. Groovy 언어어 대화형 모드
Command> groovysh
Groovy Shell (1.5.4, JVM: 1.5.0_14-b03)
Type 'help' or '\h' for help.
--------------------------------------------
groovy:000> println(9*9)
81
===> null
groovy:000> exit


2. Ruby 언어어 대화형 모드
Command> irb
irb(main):001:0> print "%d\n" % (9*9)
81
=> nil
irb(main):002:0> exit


3. JRuby 언어어 대화형 모드
Command> jirb
irb(main):001:0> print "%d\n" % (9*9)
81
=> nil
irb(main):002:0> exit


4. Python 언어어 대화형 모드
Command> python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "%d" % (9*9)
81
>>>          # 대화형 모드를 종료하기 위해 Ctrl-Z 키를 누른다.


5. Jython 언어어 대화형 모드
Command> jython
Jython 2.2.1 on java1.5.0_14
Type "copyright", "credits" or "license" for more information.
>>> print "%d" % (9*9)
81
>>> ^Z      # 대화형 모드를 종료하기 위해 Ctrl-Z 키를 누른다.


6. Ch 언어어 대화형 모드
Command> ch
                                   Ch
                Professional edition, version 5.5.0.13261
              (C) Copyright 2001-2006 SoftIntegration, Inc.
                     http://www.softintegration.com
ChShell> printf("%d\n", 9*9);
81

ChShell> exit

Posted by Scripter
,

Command> jython --version
Jython 2.2.1 on java1.5.0_14

Command> python -V
Python 2.5.1

Command> ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]

Command> jruby -v
ruby 1.8.5 (2007-12-15 rev 5200) [x86-jruby1.0.3]

Command> lua -v
Lua 5.1.3  Copyright (C) 1994-2008 Lua.org, PUC-Rio

Command> ch -v
                                   Ch
                Professional edition, version 5.5.0.13261
              (C) Copyright 2001-2006 SoftIntegration, Inc.
                     http://www.softintegration.com

Command> java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

Command> groovy -v
Groovy Version: 1.5.4 JVM: 1.5.0_14-b03

Posted by Scripter
,

lua 언어의 for 반복문 양식은

       for varName = startValue, endValue, stepValue do
             block
     end

또는

       for varName = startValue, endValue do
             block
     end

이다.

또 문자열이나 자료의 붙이기(concatenation) 연산자는 .. 이다. (즉 두 개의 점)


'
소스 파일명: for_test.lua
------------------------------[소스 시작]
local function printDan(dan)
  for i = 1, 9 do
    print( dan .. " x " .. i .. " = " .. (dan*i) )
  end
end

printDan(2)
------------------------------[소스 끝]

실행> lua for_test.lua
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18





Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.

Posted by Scripter
,