2. Ruby ¶
- 환팅하
- tryRuby
- irb
- visual studio ironRuby
- netbeans ruby플
- eclipse ruby플
- aptana (형 클)
- tryRuby
- Hello Ruby!
- 화트페
- 1- 2
- 1
-2
- 1- 2
- 화트페
- 한 향 ?!
- 한
- 1.0/0.0 -> infinity
- 123.method
- "".method
- 1.0/0.0 -> infinity
- 함 nilClass 함
- nilClass nil하, prototype . 함
- , !
- class
- nilClass nil하, prototype . 함
- 한
- 한 .
-
- Ruby.new
-
- 클 해한!( )
-
- initialize 함 하
- initialize. ( 폴트 )
class Some
def initialize
# init variablesend
end
- initialize. ( 폴트 )
- 하(@)
def initialize - 클 해한!( )
- 하!
- 함 하
class Some
def initialize
# init variablesend
end
def Some.function
# dynamic function declare
end - 함 하
@var # this is the way how declaring variable
enddef initialize
end# this is overriding
end- 함
- 클 하, 클 ?
Some2.function2 # undefined method - 클 하, 클 ?
- 클/ ?
- superclass
- superclass
def Some.function2
# new function
endSome.function2 # works!
- attr_reader/attr_writer
-
- {} def/end
- 함 () !
-
- while
- do/while
- for
- while
- 한 함
-
{| parameters| do something with parameters..}
yield : get the block and run it
a = 1, 2, 3, 4, 5
a.each {|x| puts x+1} # bloack ?(maybe)
-
-
- 해
- <- gets
- <- puts, print
- 해
- if/else 해
- rescue
- 통한 테트
UnitTest::
3. Ruby ¶
- RRobots 한 RubyLanguage Robocode
- 하 했 tcl CodeRace
- Pair Programming : Pair .
- Pair Programming : Pair .
- 함하 CodeRace
- A B 한.
- .
- Step 1
- B 하.
- 평
- A B .
- A B .
- B 하.
- A B 한.
class Layton def initialize @location = 'A' end def crossRiver printLocation @location = 'B' print " -> " printLocation print "\n" end def printLocation print @location end end
5. ¶
- "한" irb 해 해. irb , dll파 행 팝 확 . Ctrl+C N . irb 하 . 1+2 3 항 표 했( =>nil !). #define 한 . 힐 . 하, 페 하 . 트 해. -
- .. 할 ..ㅠㅠ yield yield 함 호 트 해 확하 행합. co-routine 해하 ~ 트 플 !! 태. 해 했 - 혜
- 했 한 하 ㅠㅠ -
- .. 할 ..ㅠㅠ yield yield 함 호 트 해 확하 행합. co-routine 해하 ~ 트 플 !! 태. 해 했 - 혜
- if-else ㅠ 히 . if 해 확하 호 하. C, C++, Java, JavaScript, Python 호 해 하 . " 확하 " .. 히 해 . ㅠ 형 ... . aptana... 해 한 . irb 환 할 편하. Python Shell 환 한 . 회할 "하 한 " ... 하. - 하
- 확하 하 확하 황 하 해하 하 . RubyLanguage 호 if 해 . 함 . a b 해 환해 함 add(a, b) . 할 .
- 확하 하 확하 황 하 해하 하 . RubyLanguage 호 if 해 . 함 . a b 해 환해 함 add(a, b) . 할 .
add(3,4) # => 7 환 (# RubyLanguage ) add 3,4 # => 7 환행. 확한 . add 호해 3, 4, 7 한
add(3, add(4, 7))
해 호해? 호 하 .
add 3, add 4, 7
- Ruby 하 . irb 하 Ruby 해 . 한 해 해 편하 c 하 해 확하 해 했. lua 해 wow 해. -
- irb ..ㅋㅋ 파.rb 파 한 ruby 파 파/행할 ~ - 혜
- irb ..ㅋㅋ 파.rb 파 한 ruby 파 파/행할 ~ - 혜
- 한 해. ( ) . irb editor 해 편한 파하 해 . -
- RubyLanguage 하 하 . 호 EuclideanAlgorithm 해 . 하 Netbeans 하 해~ 하 하 하 할 . -
- RubyLanguage 하 하 . 호 EuclideanAlgorithm 해 . 하 Netbeans 하 해~ 하 하 하 할 . -
- 하 하 하. 하 "" 하 . 토 하 하 ....... 하 하 . - 황
-
- RubyLanguage 학 하 해. 한 히 했 혜 테 . . 했 T_T
- CodeRace 하 한 . 하 .
- 했 CodeRace 한 혜 RubyLanguage 할 하 행했 . 했 하 하 히 하 하 확히 .
- 했 CodeRace 한 한 행하 합. -
- RubyLanguage 학 하 해. 한 히 했 혜 테 . . 했 T_T
- 회 하 했. 해 한 탁 - 혜
- Ruby 해. , 한 . 히 해. 해 ㅋㅋㅋ (1. 택 , 힙 2. 힙 3. 해 함). { |x| ~~ } 하 ? 하. -