Code Puzzle Thread

Talk about anything
just me
Posts: 5459
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Code Puzzle Thread

09 Jan 2018, 07:21

Hi Helgef,

yes, I think I solved it, but I'm waiting for others who might jump in (because I won't contribute a new puzzle).
My last hint has been my personal key to solve the problem.

:wave:
Helgef
Posts: 3163
Joined: 17 Jul 2016, 01:02
Contact:

Re: Code Puzzle Thread

09 Jan 2018, 08:21

:thumbup:. submitting new puzzles aren't mandatory, you are welcome to submit your solution whenever you like.

Cheers :wave: .
just me
Posts: 5459
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Code Puzzle Thread

09 Jan 2018, 11:27

And the answer is: 42!

Athough it should always be true, it's obviously not true in this case. I tried without success. After that I noticed, that the LOOP and the Helgef sections always give the same result, regardless of the value in Count. So I added Task.tick := 0 above Task.List:= []. The Helgef section was indeed 'significant faster' after doing this: 0 ms for 50,000 Task instances, WOW! :shock:

This seemed to be a little too fast. I realized that Task.tick isn't touched by Task.List:= [] at all. From this follows that Task.__delete() is not called. The only reason for this behaviour is: The objects are not released because 'something' still holds a reference. Some thoughts later I found this 'something'. It's the enumerator object created by while (_enum:= Task.List._newEnum()) in the ENUM section. So the real answer is:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Due to my limited knowledge about OOP and the AHK implementation details my explanation might be technically imprecise, but the solution is working.

Cheers ;) .
Helgef
Posts: 3163
Joined: 17 Jul 2016, 01:02
Contact:

Re: Code Puzzle Thread

09 Jan 2018, 12:23

You are spot on just me, both in regards to reasoning, explaination and solution, great job :thumbup:. You will be rewarded a point.

Since just me already declined the offer to submit a new puzzle, it is free for anyone who likes to, to do so.

Cheers.
_3D_
Posts: 186
Joined: 29 Jan 2014, 14:40

Re: Code Puzzle Thread

10 Jan 2018, 03:36

just me wrote:_enum := "" ; <<<<< added
Cheers ;) .
Yep my mistake.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Ty guys!
AHKv2.0 use the future now.
Mariaspencer
Posts: 1
Joined: 24 Jan 2018, 01:57
GitHub: Mariaspencer

Re: Code Puzzle Thread

24 Jan 2018, 02:06

I was also waiting for the 3D formula to apply in the game.
User avatar
nnnik
Posts: 3220
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Code Puzzle Thread

02 Feb 2018, 04:26

Puzzle:
Goals:
Disconnect the Proxy from the Target
Restrictions:
You may not edit the underlying object in memory with numput/get or similar.
You may only add new code in the marked area.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

Recommends AHK Studio
Helgef
Posts: 3163
Joined: 17 Jul 2016, 01:02
Contact:

Re: Code Puzzle Thread

02 Feb 2018, 04:49

Thank you nnnik, I will mark this as the current puzzle. You will get one point for submitting a new puzzle.

Cheers.
User avatar
derz00
Posts: 495
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: Code Puzzle Thread

03 Feb 2018, 17:13

This puzzle strikes my interest, but only in that I would like to learn more about classes. So I can't solve it :(
try it and see
...
Helgef
Posts: 3163
Joined: 17 Jul 2016, 01:02
Contact:

Re: Code Puzzle Thread

12 Mar 2018, 06:41

It seems nnnik's puzzle remains unsolved, great :D. Maybe it is time for a hint?

I have posted a bonus puzzle here, if someone wants to ponder it, it assumes some understanding of c/c++ so it is not fit for this thread.

Cheers
Helgef
Posts: 3163
Joined: 17 Jul 2016, 01:02
Contact:

Re: Code Puzzle Thread

25 May 2018, 13:05

I think it is time for a new puzzle, I leave it open to anyone who likes to submit one to do so, please see the rules in the first post and do not hesitate to ask me (via pm) if you have any questions.

This is my (pre-1.1.29.00) suggestion for a solution to nnnik's puzzle,

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Cheers.
User avatar
nnnik
Posts: 3220
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Code Puzzle Thread

25 May 2018, 14:06

Well I really searched for a solution myself for quite a while as it was a problem that I couldnt solve myself.
I was rather impressed at the speed he came up with the solution.
Also while Helgefs solution solves this riddle but does not solve the underlying problem for me since the underlying problem does not allow the addition of a static initialisation by writing a new function.
In AHK v1.1.29.00 you can use ObjGetBase and ObjSetBase to solve this.
Recommends AHK Studio

Return to “Offtopic”

Who is online

Users browsing this forum: No registered users and 7 guests