Author |
Message |
beard0
|
Posted: Tue Nov 29, 2005 5:30 pm Post subject: Turing oddities contest |
|
|
Your job is to take the following bit of code, and insert code in the middle without changing the portion I have written such that the last line (put b), and the last line only causes an error. The first person to PM me working code wins. Please PM only so as to give others a chance to work it out for themselves.
Over the course of the next little while, I will post hints as to how this can be done.
Turing: | var a : string
%This part is your job!
var b : string
b := a (5 .. *)
put a (5 .. *)
put b %This line should produce an error, and be the only one to do so!
|
EDIT:Corrected my commenting pour utuliser une langue consistent. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Hikaru79
|
|
|
|
|
MysticVegeta
|
Posted: Tue Nov 29, 2005 6:42 pm Post subject: (No subject) |
|
|
if life were like that, you wouldn't need a Visa card. |
|
|
|
|
|
beard0
|
Posted: Tue Nov 29, 2005 6:54 pm Post subject: (No subject) |
|
|
MysticVegeta wrote: if life were like that, you wouldn't need a Visa card.
What he said. |
|
|
|
|
|
beard0
|
Posted: Tue Nov 29, 2005 8:28 pm Post subject: (No subject) |
|
|
Hint number one: I have received some entries (which incidentally do not work) that attempted to take advantage of user input. No user input is required, and I'm stating now as additional criteria that you may not use input. |
|
|
|
|
|
MysticVegeta
|
Posted: Tue Nov 29, 2005 11:33 pm Post subject: (No subject) |
|
|
almost done, pretty nifty problem |
|
|
|
|
|
Paul
|
Posted: Wed Nov 30, 2005 6:23 pm Post subject: (No subject) |
|
|
Wow, I'm betting its a really obscure error
And hikaru remember its in the middle of the code, not at the end |
|
|
|
|
|
beard0
|
Posted: Wed Nov 30, 2005 11:55 pm Post subject: (No subject) |
|
|
Hint number two wrote: at
N.B. The hint is in the quote box in white. Highlight to see, unless you'd like to be a purist. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
beard0
|
Posted: Wed Nov 30, 2005 11:57 pm Post subject: (No subject) |
|
|
Paul wrote: And hikaru remember its in the middle of the code, not at the end :P
It was my error; my code originally had the "//" in the last line (I've been doing more in java of late.) and I changed it after Hikaru79 pointed it out. |
|
|
|
|
|
MysticVegeta
|
Posted: Thu Dec 01, 2005 9:06 am Post subject: (No subject) |
|
|
beard0 wrote: Hint number two wrote: at
N.B. The hint is in the quote box in white. Highlight to see, unless you'd like to be a purist.
Wow, thats a good hint! |
|
|
|
|
|
beard0
|
Posted: Thu Dec 01, 2005 9:18 am Post subject: (No subject) |
|
|
MysticVegeta wrote: Wow, thats a good hint!
Oh damn, really? I meant it to be rather cryptic as it's only the first real hint. |
|
|
|
|
|
MysticVegeta
|
Posted: Thu Dec 01, 2005 2:37 pm Post subject: (No subject) |
|
|
beard0 wrote:
rather cryptic
oh, its cryptic enough for me to not understand it |
|
|
|
|
|
beard0
|
Posted: Thu Dec 01, 2005 2:45 pm Post subject: (No subject) |
|
|
Hint Number Three wrote: When I said at, I really meant @ |
|
|
|
|
|
[Gandalf]
|
Posted: Thu Dec 01, 2005 4:50 pm Post subject: (No subject) |
|
|
Pah, if you wanted to make Turing crash there's much simpler ways .
code wrote: var a : string := string @ (241)
var b : string
b := a (5 .. *)
put a (5 .. *)
put b %This line should produce an error, and be the only one to do so! |
|
|
|
|
|
Tony
|
Posted: Thu Dec 01, 2005 5:09 pm Post subject: (No subject) |
|
|
[Gandalf] wrote: Pah, if you wanted to make Turing crash there's much simpler ways .
That just crashes the environment though.
The goal is to make put b cause an error |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|