Comments on: string song http://blodgett.doof.me.uk/2009/04/15/string-song/ place of blodgett Wed, 10 Jun 2009 09:39:16 +0000 hourly 1 https://wordpress.org/?v=5.4.2 By: blodgett http://blodgett.doof.me.uk/2009/04/15/string-song/comment-page-1/#comment-28 Wed, 15 Apr 2009 22:38:25 +0000 http://blodgett.doof.me.uk/?p=181#comment-28 this is true. but maybe harder to understand. also limits play time to thing in quotes.

]]>
By: Cakesniffer http://blodgett.doof.me.uk/2009/04/15/string-song/comment-page-1/#comment-27 Wed, 15 Apr 2009 21:56:03 +0000 http://blodgett.doof.me.uk/?p=181#comment-27 Can do like this too:

nick@pickle:~$ ruby -r ‘/tmp/apieceofstring.rb’ -e “GreatSong.new(‘cheese’).sing”
a piece of cheese
a piece of cheese
a piece of cheese
a piece of cheese
a piece of cheese
a piece of cheese
a piece of
cheese
cheese
cheese
cheese
cheese

]]>
By: blodgett http://blodgett.doof.me.uk/2009/04/15/string-song/comment-page-1/#comment-26 Wed, 15 Apr 2009 21:52:43 +0000 http://blodgett.doof.me.uk/?p=181#comment-26 it can! maybe some or all of these steps will be necessary:

acquire the shiny for your operating system from here:
http://www.ruby-lang.org/en/downloads/

open the interactive shiny! type irb in a terminal for linux and osx or open start > applications > ruby > fxri or something like that if you have the window one (like it says here: http://www.ruby-lang.org/en/documentation/quickstart/)

you might need to change to the directory where you glommed the string song to: type Dir.chdir ‘path/to/stringsong’ then press enter, where ‘path/to/stringsong’ is where it got put. single or double quotes both ok. the ruby interactive shiny should tell you ‘0’.

type require ‘apieceofstring’. this gloms the file into the interactive shiny. then you can play with it! :D

if you want song of sad, you can type GreatSong.new(‘sad’).sing
and it will sing for you sad song.

i did this and it looks a bit like this:

blodgett@home:~$ irb
irb(main):001:0> Dir.chdir ‘dl’
=> 0
irb(main):002:0> require ‘apieceofstring’
=> true
irb(main):003:0> GreatSong.new(‘fun!’).sing
a piece of fun!
a piece of fun!
a piece of fun!
a piece of fun!
a piece of fun!
a piece of fun!
a piece of
fun!
fun!
fun!
fun!
fun!
=> 5
irb(main):004:0>

]]>
By: Andrew Wilkinson http://blodgett.doof.me.uk/2009/04/15/string-song/comment-page-1/#comment-25 Wed, 15 Apr 2009 17:29:07 +0000 http://blodgett.doof.me.uk/?p=181#comment-25 I don’t know Ruby. I have downloaded the file but cannot use it. This makes me sad. Can it sing about sad things?

]]>