Subject change: In my spare time, I've been scanning the web for the perfect simulation to do as a Ruby Quiz. I don't want to do Life like everyone else does. We can do better.
So, if you can point me to a fun simulation (well described), I'll be very grateful.
If you write it up and submit it as a Ruby Quiz, you'll be my hero.
Submit address: rubyquiz@grayproductions.net
Sorry to derail the thread. We now return you to your regularly scheduled discussion of Ruby signatures...
James Edward Gray II
ยทยทยท
On Dec 5, 2004, at 9:51 PM, Brian Mitchell wrote:
I came up with a cellular automata simulator but the input and rule
set took up too much space.
I'd love to see more one-liners. They're a fun way to spread the Ruby gospel
Cheers.
-- CWS
ยทยทยท
On Mon, 6 Dec 2004 12:51:01 +0900, Brian Mitchell <binary42@gmail.com> wrote:
I am working on finding more cool one liners that are short enough for a sig.
I came up with a cellular automata simulator but the input and rule
set took up too much space. So I will have to find something else....
if not I will be sticking to my triangle signature. It is always fun
to try and push the limits of a language by doing things like this.
I am working on finding more cool one liners that are short enough
for a sig.
I came up with a cellular automata simulator but the input and
rule set took up too much space. So I will have to find something
else.... if not I will be sticking to my triangle signature.
You inspired me to another triangle one.
ยทยทยท
--
Oliver Cromm
ruby -e'require "Matrix";a=[1];(1..10).each{|n| print " "*(10-n)*3,a.map{|i|\
i.to_s.center(6)}.join,$/;a.push(0);a=(Vector[*a]+Vector[*a.reverse]).to_a}'
display: unable to open X server `'.
-e:4:in `write': Broken pipe (Errno::EPIPE)
from -e:4:in `print'
from -e:4
from -e:2:in `each'
from -e:2
from -e:2:in `each'
from -e:2
Probably a platform issue, but I gotta say I'm a bit surprised.
Gavin
ยทยทยท
On Monday, December 6, 2004, 10:43:50 PM, Michael wrote:
Stay tuned for a mail client written in or with ruby embedded that
lets you execute your sigs
Well, maybe that's overkill. This simple script is as good...
#v+
#!/usr/bin/env ruby
# Julius Plenz <jp@cvmx.de>
@exec = @lines = @lines << $_.chomp while gets
@lines.reverse.each do |line|
unless line =~ /^-- $/ @exec << line
else @exec.reverse!
ruby = IO.popen("ruby", "w+") @exec.each { |s| ruby.puts s }
ruby.puts "__END__"
ruby.each { |o| puts o }
ruby.close
end
end
display: unable to open X server `'.
-e:4:in `write': Broken pipe (Errno::EPIPE)
from -e:4:in `print'
from -e:4
from -e:2:in `each'
from -e:2
from -e:2:in `each'
from -e:2
Probably a platform issue, but I gotta say I'm a bit surprised.
Probably due to 'display'. The ruby code generates a .pnm image, which is then displayed using 'display' (ImageMagick).
You've got a type in there. It should be require "matrix" not
require "Matrix". (Or maybe it works on a windows system, because
its case insensitive?)
Yes, it works on Windows, but I changed it for future use. Thanks.
--
ruby -e'require "matrix";a=[1];(1..10).each{|n| print " "*(10-n)*3,a.map{|i|\
i.to_s.center(6)}.join,$/;a.push(0);a=(Vector[*a]+Vector[*a.reverse]).to_a}'
display: unable to open X server `'.
-e:4:in `write': Broken pipe (Errno::EPIPE)
from -e:4:in `print'
from -e:4
from -e:2:in `each'
from -e:2
from -e:2:in `each'
from -e:2
Probably a platform issue, but I gotta say I'm a bit surprised.
Probably due to 'display'. The ruby code generates a .pnm image, which
is then displayed using 'display' (ImageMagick).
display: unable to open X server `'.
-e:4:in `write': Broken pipe (Errno::EPIPE)
from -e:4:in `print'
from -e:4
from -e:2:in `each'
from -e:2
from -e:2:in `each'
from -e:2
Probably a platform issue, but I gotta say I'm a bit surprised.
Probably due to 'display'. The ruby code generates a .pnm image, which
is then displayed using 'display' (ImageMagick).
But the code doesn't require rmagick, does it?
no it doesn't require rmagick. it generates the pnm image itself (and this in 4 lines ;-).
The "display" command is there only to view the pnm image, oterhwise it would print the image on STDOUT.