hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Code optimization
Goto page Previous  1, 2, 3, 4
 
Reply to topic    hacker.org Forum Index » Crossflip View previous topic
View next topic
Code optimization
Author Message
eulerscheZahl



Joined: 29 Nov 2012
Posts: 47
Location: Germany

Post Reply with quote
Every field might affect every other field.
So, for this level you have a 12x12 matrix (you might want to remove the walls for performance, but that's not necessary). Entry m_ij is 1, if clicking field i swaps field j.
Additionally you need the initial value of the fields in the equation system.
Fri Jun 10, 2016 9:24 am View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
eulerscheZahl thanks
And what size at the last level?
What time has you at the last level?
Fri Jun 10, 2016 9:23 pm View user's profile Send private message ICQ Number
eulerscheZahl



Joined: 29 Nov 2012
Posts: 47
Location: Germany

Post Reply with quote
The last level has a size of 300*300.
It took my solver 30 minutes. After solving it I had an idea how I could reduce the time - but never implemented it.
Sat Jun 11, 2016 5:12 am View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
At such approach have we always the optimal solution (by steps quantity)?
Sat Jun 11, 2016 8:30 am View user's profile Send private message ICQ Number
eulerscheZahl



Joined: 29 Nov 2012
Posts: 47
Location: Germany

Post Reply with quote
No. This gives a solution but not the one with the minimum number of steps.
For codeeval I had to modify my code.
I doubt that it is possible to solve it with minimum number of steps in reasonable time.
Sat Jun 11, 2016 8:57 am View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
codeeval Smile And I have used it for projecteuler
Sat Jun 11, 2016 4:59 pm View user's profile Send private message ICQ Number
eulerscheZahl



Joined: 29 Nov 2012
Posts: 47
Location: Germany

Post Reply with quote
Right, projecteuler. That's how I got my nickname.
Friendkey: 288286_1f4835abc87ad033bf91098892ecc81d

Unfortunately I'm stuck there (and here at hacker.org as well).
Sun Jun 12, 2016 6:49 am View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
eulerscheZahl wrote:
The last level has a size of 300*300.

How the solution will be sent if coordinates in answer are up to FFh (255)?
Sun Jun 19, 2016 11:56 pm View user's profile Send private message ICQ Number
eulerscheZahl



Joined: 29 Nov 2012
Posts: 47
Location: Germany

Post Reply with quote
I used a format like 0010101101010...
1 means, that you have to click the field. Go from left to right and then from top to bottom.
As the answer will get quite large, you have to send it via POST instead of GET.
Mon Jun 20, 2016 6:39 am View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
tails wrote:
Hi, it took 18 seconds for me to solve the last level.
I think we can do much quicker if we use a better algorithm and a better computer.

When I finish, can you teach me? Wink it would be very informative and very interesting!
Around the 500th my time about 10 min., it isn't pleasant to me and I don't know that it is still possible to optimize Crying or Very sad
Why for games we have no topic for solved, where it would be possible to share experience and to learn?
Mon Jul 11, 2016 9:33 am View user's profile Send private message ICQ Number
AMindForeverVoyaging
Forum Admin


Joined: 28 May 2011
Posts: 455
Location: Germany

Post Reply with quote
Isaev wrote:

Why for games we have no topic for solved, where it would be possible to share experience and to learn?


Well, what do you consider as "solved"? At some points in the past, new levels had been added to some of the Puzzles if I am not mistaken. So where to draw the line?
Wed Jul 13, 2016 5:35 pm View user's profile Send private message
Hckr



Joined: 25 Mar 2010
Posts: 27

Post Reply with quote
Right.

One could simply add more levels to Crossflip and would hereby create a new level of mastery for the competing hacker community. After all, that's all we want, right? Smile
Mon Jul 18, 2016 3:10 pm View user's profile Send private message
Isaev



Joined: 16 Dec 2008
Posts: 33
Location: Germany

Post Reply with quote
[quote="AMindForeverVoyaging"]
Isaev wrote:

Well, what do you consider as "solved"? At some points in the past, new levels had been added to some of the Puzzles if I am not mistaken. So where to draw the line?

Yes, you are right. But it is all the same deprives of valuable communication with the purpose of exchange of experience. It is better to do probably new minigames, than to infinitely update old. Well or to make at once enough that obviously nobody has reached the end.
Mon Jul 18, 2016 5:46 pm View user's profile Send private message ICQ Number
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Crossflip All times are GMT
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.