Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Shuffle Puzzle
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Artimes




PostPosted: Fri Jun 03, 2005 8:38 pm   Post subject: Shuffle Puzzle

For the past few days I've been trying to figure out a effective shuffling algorithm. Once I did that, the rest only took an hour or so.

To play, type the name of the folder in which the puzzle you want to play is in (Example: "teddy"). Currently I only have one puzzle.

To make your own puzzle;
- Obtain an image
- Scale it to 300x300 pixels
- Using photo-editing software (Example: Adobe Photoshop), divide it image into a 4x4 grid (25% or 75 pixels)
- Make the top left square blank (It'll be the empty space)
- Starting from the top left, and moving across the rows, export sixteen images (75x75 pixels each), named 1...16.jpg (open teddy puzzle for an example).
- Scale the full photo to 100x100, and save it as 17.jpg
- Place all seventeen photos into a folder within the main folder, and name it as you wish.
- Load the program, type the name of your folder in, and you're off!

Eventually I will make it so you each folder will also have a text file containing information about the puzzle. For example, in the text file you will state the size of your individual images, the number of row/column, and the size of the finished puzzle image which is situated off to the right. The program will take that info, and re-adjust the screen size/calculations accordingly. I will also add small and minor GUI improvements, such as when you complete the puzzle, the completed image of the puzzle will appear without the empty space, and the grid will disappear.

NOTE: The attached file contains both executable file (.exe), and turing file (.t).



Shuffle Puzzle.zip
 Description:

Download
 Filename:  Shuffle Puzzle.zip
 Filesize:  567.93 KB
 Downloaded:  355 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Fri Jun 03, 2005 9:11 pm   Post subject: (No subject)

"An error has occured in the program: line 87, array subscript out of range."

Other than getting that error half-way through playing it, nice job man Smile A bit complicated to make a piccy, consider making a program that will auto-do that for you.

code:

  if (grid (x + i, y) = 1) then


Theres line 87. Hope that helps Very Happy [/code]
Artimes




PostPosted: Fri Jun 03, 2005 9:29 pm   Post subject: (No subject)

I didn't get that error... Confused
TheOneTrueGod




PostPosted: Fri Jun 03, 2005 10:41 pm   Post subject: (No subject)

Yah, i'm not sure how i got the error, i was just clickin around, mighta been outside of the window.
hydraweapon




PostPosted: Sat Jun 04, 2005 1:25 pm   Post subject: (No subject)

wat do u type in for the first part, when you run the program? if i type in anything it crashes
[Gandalf]




PostPosted: Sat Jun 04, 2005 8:31 pm   Post subject: (No subject)

Read the instructions in the post next time:
Quote:
To play, type the name of the folder in which the puzzle you want to play is in (Example: "teddy"). Currently I only have one puzzle.

To make your own puzzle;
- Obtain an image
- Scale it to 300x300 pixels
- Using photo-editing software (Example: Adobe Photoshop), divide it image into a 4x4 grid (25% or 75 pixels)
- Make the top left square blank (It'll be the empty space)
- Starting from the top left, and moving across the rows, export sixteen images (75x75 pixels each), named 1...16.jpg (open teddy puzzle for an example).
- Scale the full photo to 100x100, and save it as 17.jpg
- Place all seventeen photos into a folder within the main folder, and name it as you wish.
- Load the program, type the name of your folder in, and you're off!


Good game, just add a "save" feature for the position, and support for larger puzzles.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: