Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing oddities contest
Index -> Contests
Goto page Previous  1, 2, 3
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
beard0




PostPosted: Sat Dec 10, 2005 3:30 pm   Post subject: (No subject)

Entries being not forthcomming, here is the winning code, a Cervantes-Tony collaboration:
Turing:
var a : string

var hack : string := "tony*hack"  % just a string
char@(addr (hack) + 4) := chr (128) % splice EOS as 5th (*) character
a := string@(addr (hack))   % assign manipulated string to a

var b : string
b := a (5 .. *)
put a (5 .. *)
put b


And this is the slightly simpler version:
Turing:
var a : string

a := "    "
nat1@(addr (a) + 4) := 128

var b : string
b := a (5 .. *)
put a (5 .. *)
put b


I don't know why the third variable was introduced, nor why the last line of their portion of the code is done as it is - a:=hack would have sufficed.

Due to the nature of the winners (that is, mod & admin) no bits will be given for winning. Another prize therefore is neaded, and so, I give you a cookie: Click for your cookie.
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Sun Dec 11, 2005 2:31 am   Post subject: (No subject)

Oh my god its 128!! I was setting it at different numbers, didnt work!
beard0




PostPosted: Sun Dec 11, 2005 12:03 pm   Post subject: (No subject)

Try running this code Very Happy:
code:
var a : string
put nat1@(addr (a))
Tony




PostPosted: Sun Dec 11, 2005 4:31 pm   Post subject: (No subject)

umm... yeah, the code was work-in-progress, and I was trying different things in there... and haven't cleaned up the submission. Razz

Thx for the cookie
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 3 of 3  [ 34 Posts ]
Goto page Previous  1, 2, 3
Jump to:   


Style:  
Search: