# Mac OS X Cube Timer



## byu (Jun 11, 2009)

This idea of mine has multiple parts. I've always wanted to use CCT. But my computer, doesn't have an Intel core processor, meaning I can't run the latest version of Java, therefore meaning I cannot run CCT.

So, I've been looking for an extremely flexible alternative, and stumbled across JNetCube. Works good, but the interface is too fixed for me. I can't do averages of more than 12 without turning it into a rolling average, etc.

So, I'm going to TRY to create an eloquent, flexible timer program using the Apple Xcode Developer Tools, written in Objective-C designed specifically for Mac OS X Leopard. I have the following books that I will be basing a lot of the code off of:

Programming in Objective-C (Stefan G. Kochan)
Cocoa Programming for Mac OS X Third Edition (Aaron Hillegass)
Learning Cocoa with Objective-C (James Duncan Davidson)

I have a few more, but those are the only ones specifically about Objective-C and Cocoa. If any of you Mac users are interested, I can send you a beta version that I'm working on right now.

Also, if some PC users could give a detailed list of features in CCT that are your favorites, that would be great, because I could try to implement them.

EDIT: Also, I'm looking for a neat name for a program. If you have a good one, let me know.


----------



## masterofthebass (Jun 11, 2009)

eww objective-C. if you really want to be cool, do it in pyobjc  I've been thinking of doing some sort of Cocoa app since I learned the basics of it, but I haven't had any good ideas. Good luck with a program like this, I'll be somewhat of an epic undertaking.


----------



## byu (Jun 11, 2009)

I'm having some very strange difficulty just getting the program to work properly. Any Cocoa users out there? I might have to go to a programming forum.

Basically, I have a XIB file with the entire interface in it, with connections to File's Owner, which is an instance of the class Controller. Controller has two instance variables, timerField and description. I have pointers in the XIB connection Controller to the interface items.

Back in the Controller class, I have implemented awakeFromNib, but it NEVER gets called. Any ideas?


----------



## masterofthebass (Jun 11, 2009)

uh... that seems sort of vague for me. awakeFromNib is supposed to do what? Unless its set to one of the interface things, it won't be called.


----------



## byu (Jun 11, 2009)

awakeFromNib is supposed to be one of the first methods run (other than ones like alloc and init) for a class, and it's supposed to be done automatically.


----------



## masterofthebass (Jun 11, 2009)

o well... I don't really know anything other than what i needed to make a scrambler. I got too lazy to finish it though.


----------



## byu (Jun 11, 2009)

Oh wow, I just realized that you don't connect it to the File's Owner, you create a new object...


----------



## Roux-er (Jun 11, 2009)

I'll try a beta! I would be more than happy to try it!


----------



## JBCM627 (Jun 11, 2009)

Why a mac-only timer? Why not just make one thats easy to port to any OS... so use a framework like Qt or something?



Wanda the Fish said:


> Q: What's the difference between a Mac and an Etch-A-Sketch?
> A: You don't have to shake the Mac to clear the screen.


----------



## joey (Jun 11, 2009)

By the way, I used CCT on a non-intel mac.


----------



## MichaelErskine (Jun 11, 2009)

Why not just alter JNetCube to suit your needs - it's quite well written and easily modified.


----------



## tim (Jun 11, 2009)

byu said:


> I'm having some very strange difficulty just getting the program to work properly. Any Cocoa users out there? I might have to go to a programming forum.



Use MacRuby. Enough said .
btw. This might help: http://www.cocoabuilder.com/archive/message/cocoa/2005/10/6/147656.



msemtd said:


> Why not just alter JNetCube to suit your needs - it's *quite well written* and easily modified.



What? Have you ever looked at the source code? Four different classes with lots of duplicated code for 2x2x2 - 5x5x5 scramblers is just ugly. Adding a scrambler requires you to write a lot of code in several places.


```
private boolean isParallel(int thisArray, int thatArray){
  if (thisArray == thatArray){
    return true;
  } else {
    return false;
  }
} // end isParallel
```

I don't know what's worse: the unnecessary comment at the end, the missing whitspace after the if statement, the misleading variable names or the way he made a one-liner into a five-liner.


----------



## joey (Jun 11, 2009)

Eww, I won't take a look at the rest of the code 

(In my previous post I mentioned I used CCT on a non-intel mac, didn't know they only released an intel Java6 now, but sure you could find the PPC one somewhere)


----------



## byu (Jun 11, 2009)

My very simplistic beta (timing only, no averages yet) entitled CubeX (I couldn't think of any title, and that's what came to mind first) should be out later today, unless I run into a strange compilation error (which is very possible).


----------



## JTW2007 (Jun 11, 2009)

I'd love a beta for my mac! When it comes to my favorite features on CCT: Editable tags for solves, comment space, ability to use a stackmat timer, scramble display (so you can check the scramble), and lots of flexibility when it comes to color and system layout.

The cons of CCT: Not enough puzzles (no pyraminx, skewb, relays, or editable session tags), hard to make it work on my mac, not enough space in the comment box.

Anyway, this sounds like a great idea!


----------



## masterofthebass (Jun 11, 2009)

JTW2007 said:


> The cons of CCT: Not enough puzzles (no pyraminx, skewb, relays, or editable session tags), hard to make it work on my mac, not enough space in the comment box.



I have pyraminx, skewb, clock, and other scramble plugins available if you want. The scrambling part of CCT is actually one of the best, because it allows for expansion, unlike other programs. Also, the pyraminx plugin is available on the CCT website.


----------



## JTW2007 (Jun 11, 2009)

masterofthebass said:


> I have pyraminx, skewb, clock, and other scramble plugins available if you want. The scrambling part of CCT is actually one of the best, because it allows for expansion, unlike other programs. Also, the pyraminx plugin is available on the CCT website.



That'd be awesome. I'll PM you so as not to hijack the thread.


----------



## masterofthebass (Jun 11, 2009)

I'll just attach it here for everyone using mac. It seems that my .class files compiled on OS X don't transfer over to Windows users  In this zip file there are 3 files that you place in the ScramblePlugins folder of your CCT folder.


----------



## brunson (Jun 11, 2009)

JBCM627 said:


> Why a mac-only timer? Why not just make one thats easy to port to any OS... so use a framework like Qt or something?
> 
> 
> 
> ...


QT is really cool to program in. Interobject communication is been abstracted and simplified an a really awesome way.


----------



## MichaelErskine (Jun 11, 2009)

tim said:


> What? Have you ever looked at the source code?


Well, yes I have, but I can't say I remember that particular atrocity.


----------



## d4m4s74 (Jun 12, 2009)

I googled a bit, java for powerpc:
SoyLatte

http://landonf.bikemonkey.org/static/soylatte/

haven't tested it though, don't have a non-intel mac


----------



## Ellis (Jun 12, 2009)

d4m4s74 said:


> I googled a bit, java for powerpc:
> SoyLatte
> 
> http://landonf.bikemonkey.org/static/soylatte/
> ...



Why does it say intel?


----------



## d4m4s74 (Jun 12, 2009)

Ellis said:


> d4m4s74 said:
> 
> 
> > I googled a bit, java for powerpc:
> ...


whoops, posted the wrong link, time for some googling


----------



## panyan (Jun 12, 2009)

YES! i love my mac and any cube programs for it would be much appreciated


----------



## JTW2007 (Jun 13, 2009)

masterofthebass said:


> I'll just attach it here for everyone using mac. It seems that my .class files compiled on OS X don't transfer over to Windows users  In this zip file there are 3 files that you place in the ScramblePlugins folder of your CCT folder.



Can't thank you enough! Good stuff.


----------



## jfly (Jun 13, 2009)

masterofthebass: Woah! I didn't know you had done skewb! That's awesome. I really should go on irc more often...



masterofthebass said:


> It seems that my .class files compiled on OS X don't transfer over to Windows users :



Yeah... stupid java.


----------



## jfly (Jun 13, 2009)

For fear of getting asked to do this myself, I'll just mention that it really shouldn't be too much work to get cct running on java 1.5. You'd lose the splash screen, and have to include another jar file (swing-worker). Also, the look and feel (substance) probably isn't 1.5 compatible. But all the important stuff is. Either way, it's probably a much smaller undertaking to make cct java 1.5 compatible than it would be to rewrite it.


----------



## byu (Jun 13, 2009)

panyan said:


> YES! i love my mac and any cube programs for it would be much appreciated



Give me some suggestions, I'll work on them. The timer is complicated, for a time like 16.39, it appears as

16.390000000000000

and I can't figure out how to fix that.



j-fly said:


> For fear of getting asked to do this myself, I'll just mention that it really shouldn't be too much work to get cct running on java 1.5. You'd lose the splash screen, and have to include another jar file (swing-worker). Also, the look and feel (substance) probably isn't 1.5 compatible. But all the important stuff is. Either way, it's probably a much smaller undertaking to make cct java 1.5 compatible than it would be to rewrite it.



Anyone willing to try this?


----------



## tim (Jun 13, 2009)

byu said:


> panyan said:
> 
> 
> > YES! i love my mac and any cube programs for it would be much appreciated
> ...



http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html

Took me about 5.000000000000s to google it.


----------

