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  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
beard0




PostPosted: Thu Dec 01, 2005 5:36 pm   Post subject: (No subject)

Gandalf: Did you not maybe think that there was a reason I had my hint in white on a white background? Could a mod please remove Gandalf's post to allow those who haven't yet seen it to choose whether to use the hint?
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Dec 01, 2005 5:55 pm   Post subject: (No subject)

There i did not delete anything to his post, just made it so the user has a choice Wink
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
[Gandalf]




PostPosted: Thu Dec 01, 2005 6:14 pm   Post subject: (No subject)

Sorry, I didn't think of making a quote white, or even of the spoiler aspect.
I realized that it doesn't do the objective, but it does show how to use his example, and the instability it (which I guess causes the error).
MysticVegeta




PostPosted: Fri Dec 02, 2005 12:03 pm   Post subject: (No subject)

Whens the fourth *useful* hint coming? Laughing
beard0




PostPosted: Fri Dec 02, 2005 12:09 pm   Post subject: (No subject)

Hint Number Four wrote:
addr
Tony




PostPosted: Fri Dec 02, 2005 12:20 pm   Post subject: (No subject)

I just want to point out that hints 2,3 and 4 say the exact same thing, just in a different word
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
beard0




PostPosted: Fri Dec 02, 2005 12:26 pm   Post subject: (No subject)

Tony wrote:
I just want to point out that hints 2,3 and 4 say the exact same thing, just in a different word


Each makes it eaiser and easier to find the relevant information in the turing help manual. The next hint will be a completely new one.
Tony




PostPosted: Fri Dec 02, 2005 12:33 pm   Post subject: (No subject)

I think a good hint to consider, is letting us know what the error generated is.. unless it gives away too much. It's your call Smile
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Fri Dec 02, 2005 12:36 pm   Post subject: (No subject)

Tony wrote:
I think a good hint to consider, is letting us know what the error generated is.. unless it gives away too much. It's your call :)


Tony's hint wrote:
Variable has no value
Cervantes




PostPosted: Fri Dec 02, 2005 4:41 pm   Post subject: (No subject)

beard0 wrote:
Tony wrote:
I just want to point out that hints 2,3 and 4 say the exact same thing, just in a different word


Each makes it eaiser and easier to find the relevant information in the turing help manual. The next hint will be a completely new one.


Yeah, too bad wine won't load the Turing Help Manual. Can't research these hints. Sad

On a topic related to the Tony's Hint, Cervantes wrote:

Well, I know the reason why b has no value. If anyone wants to collaborate with me...

Shifty
[Gandalf]




PostPosted: Fri Dec 02, 2005 5:22 pm   Post subject: (No subject)

Thanks beard0, that last hint was just what I was looking for. Now if only I can remember what I was going to do with it... I think from now on, I will just white out my whole post relating to this...

What I have so far:
...
var a : string
var ab : string := "abcde"
a := string @ (addr(ab))
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!

...
Not much Confused It might be on the right track, but I have a feeling there is quite a bit more to it than that...
MysticVegeta




PostPosted: Sat Dec 03, 2005 6:01 pm   Post subject: (No subject)

Hmm I get the logic of it, and what error it should give but i am having a hard time implementing it. Mad
beard0




PostPosted: Mon Dec 05, 2005 9:22 am   Post subject: (No subject)

Errr. [Gandalf], this is also still a contest - not so much on the unofficial hints eh? If you like, PM me your partial solutions, and I'll post at the end how things were going.
Hint Number whatever-this-is wrote:
put "" + chr(128)


Cervantes: Unless you happen to know these commands, this will be impossible without the reference manual:

Turing Manual wrote:
Syntax addr (reference)

Description The addr attribute is used to find the integer address of a variable or non scalar constant. This is implementation-dependent. This address may be used in an indirection operation @.

Example Set a to be the address of x.

var x : real
var a : addressint := addr (x)

Details The value of the address produced by addr is of type addressint, an integer type whose range is that of the underlying memory addresses.
The concept of an address is implementation-dependent. For example, an optimizing compiler could determine that a variable does not require space because the program could be computed without the variable with no change in output. However, in most implementations, types have a predictable size and variables of that type occupy that number of bytes in memory.


---------



Syntax targetType @ ( expn )

Description The indirection operator @ is used to access values that lie at absolute machine addresses in the computer's memory. This is dangerous and implementation-dependent and can cause arbitrary corruption of data and programs.

Example Copy the byte value at memory location 246 into b and then set that memory byte to zero.

var b : nat1 % One byte natural number
b := nat1 @ (246)
nat1 @ (246) := 0

Details The form of targetType must be one of:

(a) [ id . ] typeId
(b) int, int1, int2 or int4
(c) nat, nat1, nat2 or nat4
(d) boolean
(e) char [ ( numberOfCharacters ) ]
(f) string [ ( maximumLength ) ]
(g) addressint
In form (a) the beginning identifier id must be the name of a module, monitor or class that exports the typeId. Each of numberOfCharacters and maximumLength must be compile time integer expressions. These are the same target types as in type cheats.
The indirection operator @ takes an integer as an address. This value must fit in the range of addressint. See addressint. See also pointer types and the ^ operator (which accesses objects located by pointers).
Tony




PostPosted: Mon Dec 05, 2005 9:41 am   Post subject: (No subject)

Quote:
In such case Cervantes and I have came up with a solution back when he posted.. we were just off on the character to use. Tried with a different EOS character chr(0) instead of chr(128).


I'll PM you the code
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
beard0




PostPosted: Mon Dec 05, 2005 9:59 am   Post subject: (No subject)

We have a winner! Looking for a more simple version for a second place. (Winners are automatically disqualified from the running for second.)
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

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


Style:  
Search: