This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Improving code  RSS feed

Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some code I am writing I am looking to improve. What it does is attempt to solve a puzzle of blocks, by orienting them in every possible permutation to see if they fit in.

Note that I am using enums for orientation, but not for the block position. Why? Because I am using the block position as an index into arraylists, and also walk through the positions in an incrementing manner (like an int). Is this a correct strategy, or should I use enums after all?

This particular routine counts the number of valid permutations which the blocks fit together correctly.

Am I cloning things properly? (I am trying to just do a shallow copy)

Thanks for any ideas on how to improve it.

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!