2007/12/20 - [Programming/Ruby] - [Golf] 22 bytes -2000 to -10000
Works only if the process number is 801 and pid is 1989.
-----------------------------------------------------------------
## Unfortunately, this code doesn't work, since id is a method and assigning a value to a method is impossible. I thought this code is valid because when I was testing my code with
, this one worked properly. Seems that id=1989 creates a variable named id and it overrides the same-named method afterwards, which makes id+=10 valid. On the other hand, if I run id+=10 from the beginning, the interpreter thinks there must be a variable named id but cannot find one except the Kernel.id method, and of course raises an error. ##
Works only if the process number is 801 and pid is 1989.
-----------------------------------------------------------------
## Unfortunately, this code doesn't work, since id is a method and assigning a value to a method is impossible. I thought this code is valid because when I was testing my code with
, this one worked properly. Seems that id=1989 creates a variable named id and it overrides the same-named method afterwards, which makes id+=10 valid. On the other hand, if I run id+=10 from the beginning, the interpreter thinks there must be a variable named id but cannot find one except the Kernel.id method, and of course raises an error. ##
'Programming > Ruby' 카테고리의 다른 글
| [CodeGolf] Choose (2) | 2008/01/25 |
|---|---|
| [Anarchy Golf] leap year (6) | 2008/01/11 |
| [Golf] Luck-based 18B -2000 to -10000 (0) | 2007/12/20 |
| [Golf] 22 bytes -2000 to -10000 (0) | 2007/12/20 |
| [Anarchy Golf] 최근 현황 (2) | 2007/11/16 |
| [Anarchy Golf] Google (0) | 2007/11/08 |



