Computer Science Canada

DWITE 2006-2007

Author:  Mr.S. [ Wed Sep 13, 2006 5:20 am ]
Post subject:  DWITE 2006-2007

DWITE will be starting up again this year, beginning with an Earlybird contest on October 3. Visit www.dwite.org for all of the details.

I beleive there was a bit of interest in including Ruby submissions. If someone can direct me to a copy of a command-line compiler for Ruby, I'll look into including it.

Cheers. Mr.S.

Author:  rdrake [ Wed Sep 13, 2006 2:07 pm ]
Post subject:  Re: DWITE 2006-2007

Mr.S. wrote:
I beleive there was a bit of interest in including Ruby submissions. If someone can direct me to a copy of a command-line compiler for Ruby, I'll look into including it.
Ruby programs are not typically compiled... they're interpreted. You just run the following, and it goes about its way.
code:
ruby myfile.rb
You can fetch the one-click-installer for Windows here.

Author:  Tony [ Thu Sep 14, 2006 10:36 pm ]
Post subject: 

excellent Smile the bulk of my commentary is posted at the compsci.ca blog, though in summary - "register if you can"

Ruby would make programming contests too easy Laughing

Author:  Flikerator [ Sun Oct 15, 2006 12:26 pm ]
Post subject: 

Too late to join? I just found out about DWITE Confused

Author:  Tony [ Sun Oct 15, 2006 2:33 pm ]
Post subject: 

Flikerator wrote:
Too late to join?

Oh no, you can join in at any time. There are 5 more events this year. Next one is Monday, October 30. It's recommended that you register at least 48 hours prior though. Good luck.

Author:  Mr.S. [ Thu Nov 02, 2006 8:32 pm ]
Post subject:  Re: DWITE 2006-2007

I now have Ruby-185-21 installed on the DWITE Judge's computer. I also have RubyScript2Ex3e from http://www.erikveen.dds.nl/rubyscript2exe/index.html also installed on the computer.

This may seem like a simple request, but I need someone to write me the Ruby code for the following problem. Once I have the code I can test out Ruby on the DWITE judge.

Thank you. Mr.S.

Sample Problem

Write a program that will calculate the square of a number rounded to two decimal places.

The input file, DATA11.txt, will contain 5 numbers, on separate lines, each between -32768 and 32767.
For Example:
0
23.45
-1234
-32760.789
999


The output file, OUT11.txt, will contain, left justified, on five lines, the squares of the corresponding values from the input file.
For Example:
0.00
549.90
1522756.00
1073269295.90
998001.00




rdrake wrote:
Mr.S. wrote:
I beleive there was a bit of interest in including Ruby submissions. If someone can direct me to a copy of a command-line compiler for Ruby, I'll look into including it.
Ruby programs are not typically compiled... they're interpreted. You just run the following, and it goes about its way.
code:
ruby myfile.rb
You can fetch the one-click-installer for Windows here.

Author:  Tony [ Thu Nov 02, 2006 9:57 pm ]
Post subject: 

sure thing
Ruby:

outFile = File.new("OUT11.txt","w")
File.new("DATA11.txt","r").each_line{|num|
    outFile << sprintf("%0.2f", num.to_f*num.to_f) << "\n"
}
outFile.close

Author:  Mr.S. [ Sat Nov 04, 2006 9:05 pm ]
Post subject: 

Well I seem to have Ruby working on the DWITE judge. RubyScript2Exe - A Ruby Compiler makes a honkin' huge .exe of the sample program below (1,140 KB). The .exe is very slow also...aproximately 1300 milliseconds, compared to approximately 100 milliseconds with a Pascal submission. Teams are welcome to try submissions in Ruby for the next contest.

Mr.S.

Tony wrote:
sure thing
Ruby:

outFile = File.new("OUT11.txt","w")
File.new("DATA11.txt","r").each_line{|num|
    outFile << sprintf("%0.2f", num.to_f*num.to_f) << "\n"
}
outFile.close

Author:  Tony [ Sun Nov 05, 2006 10:47 pm ]
Post subject: 

What is the purpose of 'compiling' Ruby to an .exe anyways? It's an interprative language, just run it through an interpreter

code:

ruby PROGRAM11.rb


granted that the judge would need to be modified for this case. So instead of the usual

compile -> run out.exe

it would skip compile and go straight for

ruby out.rb

The performance should be _much_ better though (and I'm not sure on how compatable RubyScript2Exe is

Author:  Mr.S. [ Tue Nov 07, 2006 6:13 am ]
Post subject: 

Yes, the judge would be need to be modified to handle this case. I was just keeping consistent between the several different programming environments. I'll see what happens in the November contest, to determine if I should modify the code.

Which makes me think about Turing....Is it possible to run a Turing solution this way also? Something like...
code:

winoot program11.t

I could probably look into it, but if someone knows, it could save me some time.

Mr.S.

Tony wrote:
What is the purpose of 'compiling' Ruby to an .exe anyways? It's an interprative language, just run it through an interpreter

code:

ruby PROGRAM11.rb


granted that the judge would need to be modified for this case. So instead of the usual

compile -> run out.exe

it would skip compile and go straight for

ruby out.rb

The performance should be _much_ better though (and I'm not sure on how compatable RubyScript2Exe is

Author:  Tony [ Tue Nov 07, 2006 9:30 am ]
Post subject: 

weren't we all looking for a command line turing compiler a while back, and got a non-working executable from Tom? Laughing

Author:  wtd [ Tue Nov 07, 2006 11:48 am ]
Post subject: 

The Ruby "compiler" simply statically links your program into the Ruby interpreter. This is essentially how the Turing "compile" works as well.

There is no reason a Ruby program handled this way would be any faster than any other Ruby program, as it is still being handled by the same interpreter.

Author:  Dan [ Tue Nov 07, 2006 5:39 pm ]
Post subject: 

Tony wrote:
weren't we all looking for a command line turing compiler a while back, and got a non-working executable from Tom? Laughing


Yep, i even tested that thing on every verson of turing know and not know to exists. Incuding such unreported copys as 4.0.5 and 4.1. Also e-mailed tom myself serveral times and have never got a responced from him. Maybe he died?


: