2013-06-09から1日間の記事一覧

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

x,y=1 #x=[]; y=1

x,y,*z=1,*[2,3,4] #x=1;y=2;z=[3,4];#operator puts (0b1011 puts (0b10110 >> 2).to_s(2) #101 puts 11 puts 22>>2 #5message="hello" messages=[] message messages

x,y=1,2 #x=[1]; y=2

x,y=1,2,3 #x=[1,2]; y=3

Expressions and Operator

#method invocations puts "hello world" #"puts" invoked on self , with one string arg puts Math.sqrt(2) #"sqrt" invoked on object Math with one arg message="hello world" puts message.length #"length" invoked on object message;no args a=[0,1…