Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-18-2013, 02:24 AM   PM User | #1
beginningjs
New to the CF scene

 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
beginningjs is an unknown quantity at this point
help with 15 piece puzzle please

http://pastebin.com/A2hRmSU2

hi so i am working on a group project for my CS class to build a 15 piece puzzle in javascript. The other group member wrote up some code which i dont understand he is unwilling to comment, so now i have to try and find moveable pieces but i have no idea how to go about it. His shuffling algorithm works perfectly well but seems uncomprehensible to me. Please help. I have posted the JS code on pastebin. Thanks
beginningjs is offline   Reply With Quote
Old 02-18-2013, 06:37 AM   PM User | #2
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,907
Thanks: 10
Thanked 293 Times in 289 Posts
Dormilich is on a distinguished road
the code shown is basically a way (though not very efficient) to scramble the tiles without repetition. but that still doesn’t prevent half of the configurations to be unsolvable.

you might look at http://bytes.kulturbeutel-leipzig.net/MagicSquare.xhtml for inspiration, there’s some more explanation.
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:12 AM.


Advertisement
Log in to turn off these ads.