Code Puzzle Thread

Talk about anything
just me
Posts: 5331
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: 2898
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: 5331
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: 2898
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: 176
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: 2790
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: 2898
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: 478
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: 2898
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

Return to “Offtopic”

Who is online

Users browsing this forum: No registered users and 3 guests