New Cube Timer for Nintendo DS

I did try holding down two buttons in stackmat fashion, but after that you can still stop it with one button. Am I missing something?

Ah so you are saying you dont want it to stop unless you press both sides... hmmm, I hadn't considered that.

Yes, that's how a stackmat works. If implemented you should have an option to choose one button or stackmat mode.

Hmm, well I'm wondering if it's really worth it. I assume the most important thing here is keeping both hands off the cube when the timer *starts*, as once it's finished I don't think it would make any difference in your time whether you stop the timer with one hand or both hands (am I wrong?). Trying to slap both ends of a ds at the same time to stop it should actually be much harder to accomplish than slapping a stackmat, and would probably harm your times, I would think. (if you tend to miss or something :p)

As it is, you *can* slap both ends to stop it, it will just stop as soon as the first press is recognized. Is this that unacceptable? If it is I can try to change it this weekend.

I see what you are saying. Especially since you can't "throw" the cube down because it would hit the top screen. :p I think using one button is fine.
 
Well I was trying to implement a very basic form of tracking times today, but its too big of a problem for me to easily solve and I didn't really feel like thinking about it too hard :p

I think I might try working on the idea someone had about displaying a list of algorithms.
 
I updated the SVN repository today. I didn't really know what I was doing though, so I deleted everything from it and then uploaded all new files. I'm going to have to learn how to use this thing...

anyway, I have added 3 buttons to the interface: Time Editor, Change Puzzle, and Algorithm Viewer. The first two buttons do not do anything, they are just there for future use. I have added a file browser which is brought up when you press the Algorithm Viewer button. I will be implementing the algorithm page through this file browser. I suspect that the file browser code might also be useful for displaying a list of times.

Also, I made a small change to keep people from accidentally restarting the timer right after they stop it.

There is no new release of the program at the moment, as none of these changes offer a significant change for users.
 
OH
If you want a code snippet to parse a txt file, I have one from my old project.
Don't forget to inlude fat.h, stdio.h, and string.h
Also, don't have time to go over it right now (have to right an essay for tomorrow and it's 10:00 PM where I live)
If you don't understand it, I'll try and explain it a little later, basically I needed it for my game because it had editable maps, and the maps would be embedded in a txt file.
Code:
void loadMap(void)
{	
	FILE *lvlset;
	//brick br[144];
	int p = 0;
	int num = 2;
	int x = 5;
	int y = 5;
	int rowCount = 0;
	char nameline[17];
	char temp = 'n';
	char grid[145];
	lvlset = fopen("Diamonds.txt","r");
	PA_LoadSpritePal(0, 1, (void*)block_lb_Pal);
	//PA_CreateSprite(0, 10, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, 50, 50); // Added this back just to see what a block shoudl look like
	if(lvlset==NULL)
		while(1);
	else
	{
		//PA_OutputText(1,1,1,"file open"); //testing line
		//PA_WaitFor(Pad.Newpress.Start); //testing line
		if(prev == LEVEL)
		{
			lvlset += counter;
			while(temp != '/')
			{
				temp = fgetc(lvlset);
				nameline[p] = temp;
				p++;
				counter++;
			}
			nameline[p-1] = '\0'; //to terminate your string - I had a mistake here, should be p-1 not p or p+1...
			PA_OutputText(1,0,0,"%s",nameline);   //testing line
			
			//PA_WaitFor(Pad.Newpress.Start);  //testing line
			p = 0;
			prev = NAME;
		}
		//here you could start parsing the grid. I noticed that there was an extra / after the first grid line below Simpleton, so you'll want to remove that.
		//Also there are spaces at the end of each line so that can pose a problem if you kept using fgetc to pick up each grid item
		//okay, so the level grid could be char grid[145] or something like that (1 larger than 12x12) or... possibly you could have an
		// integer array instead and if a certain character were met in the file the array would be filled with a particular number. Each number would have to
		//refer to some character and you'd end up needing another key of some kind if you went that way...
		//anyway, there are options from here forward so let me know if you need any more help!
		if(prev == NAME)
		{
			lvlset += counter;
			while(temp != '/')
			{
				temp = fgetc(lvlset);
				grid[p] = temp;
				p++;
				counter++;
			}
			grid[p-1] = '\0';
			
			p = 0;
			
			while(p != 145)
			{
				if(grid[p] == '~')
				{
					PA_CreateSprite(0, num, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, x, y);
					num++;
				}
				x += 20;
				rowCount++;
				if(rowCount == 12)
				{
					x = 5;
					y += 12;
				}
				p++;
			}
			
			p = 0;
			prev = LEVEL;
		}
		fclose(lvlset);
	}

}
 
Bounb, you ever have any luck with saving the times to a file? If not I can maybe take a look and see if I can figure out whats wrong with it.
 
I suggest this program should be liscensed under WTFPL:
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar
14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE **** YOU WANT TO.

This is an example, obviously your name is not Sam whatever and you don't live in Paris. Unless it is and you do, and in that case, keep it the way it is.
 
Last edited:
Lol, not a bad license, but the google code page wont let me use a custom one like that.

I worked on the algorithm viewer a bit more today, its sort of starting to come together.
 
Sorry I have not had a chance to look into time saving further. You just need to pass the time to a buffer or what ever, the rest of the code for writing to file I already posted.
 
Ok, I'm probably going to look into rewriting the time so it works a bit better.

Before that, can anyone think of any changes that I should make to the inspection time feature? I don't want to have to redo this more than once :p
 
Somewhat good news! I've got my algorithm viewer sort of working! It's riddled with bugs right now though :p
Hopefully I'll pop out a new release this weekend.
 
Ok, I have the algorithm viewer fully functional! But before I release it, I would like someone to please help me out with generating the content for it.

The algorithm viewer is really just a simple image viewer. My idea is to have images of each case, like on the wiki: http://www.speedsolving.com/wiki/index.php/OLL

However, instead of having the algorithms written in text, they need to be contained in the image itself. The nds screen size is 256x192, and images must be in the GIF format.
Would anyone like to help with this?
(users will be able to add their own custom images if they don't like the default ones, I just want to have some default content for it)
 
I just released version 0.4 (download in the first post).
This version has added an algorithm viewer, and a list of your last 12 times.

The times are currently not saved when you turn the power off. I have only included a handful of algorithms for the algorithm viewer at the moment, just to demonstrate this feature.
 
Very cool, I especially like the no inspection countdown thing being just 0 instead of 00:00.01.
So for this algorithm viewer, do I need to put the gifs on my SD card or something? Like do I need to make a separate folder? Cause when I press on Algorithm Viewer it says "no files found in /CuTiDS/".
 
This is way better than the fist release, well done everyone involved. (better font too)

The algorithm viewer is neat, it would be easy to create and add your own too.

Would be even better if it displayed the rolling 3/5 average of the last 5 solves
 
I see what you are saying. Especially since you can't "throw" the cube down because it would hit the top screen. :p

I was thinking about this, and I decided that it would be a good idea to flip the top screen upside down. This way you can use the ds just like a stackmat timer, with it between yourself and the cube. Just make sure not to throw your cube down on the ds.

I released version 0.5 today with the option to flip the screen. It turned out to be a much more difficult problem than I had anticipated, but it worked out fairly well. As a side effect, your list of times will disappear whenever the timer is running, but that shouldn't be a problem since you don't need to be looking at the ds when the timer is running anyway.

I was trying really hard to implement averages and other stats in this version, but it turned out to be a very difficult problem, and I was not able to work out how to accomplish it. I think development has gone about as far as I can take it. I'm going to need help from here on out if anything else gets done.
 
Last edited:
Back
Top