Page 1 of 6 123 ... LastLast
Results 1 to 10 of 56

Thread: Preview of my JavaScript Timer

Hybrid View

  1. #1

    Default Preview of my JavaScript Timer

    Link:
    http://k073.webs.com/timer.html
    If the link fails to load, the server is updating and you have to wait a while before it can load again.

    This timer is based on blah a.k.a. zzzonked's timer
    Functions:
    - tap [spacebar] to start timer and any key to stop
    - the time is accurate because the timer is started when the spacebar is released and stopped whenever any button is pressed
    - press '2' for 2x2 and again to enter BLD mode and again to get back to speed mode, press 3 for 3x3 and so on till 7x7. Press '9' for pyraminx
    - press 'L' to view last scramble
    - press 'Q' to display full details for each solve
    - press 'P' to mark the current time as PLL skip and press 'O' for OLL skip
    - press [escape] followed by [enter] to reset the times
    - press 'D' to mark the current time as 'DNF' and press again to mark it as a +2 penalty and again to cancel the penalty
    - hover on a time marked as 'DNF' to show the raw time
    - press [delete] or [backspace] to delete current time
    - click and drag the scramble preview to move the preview somewhere else because it might be blocking the scramble(or time)
    - click on the time or press 'F' to toggle between full screen mode and normal mode(only applicable to browsers other than IE)
    - click on the mean time or press 'M' to get the details including scrambles(suitable for doing small averages) and tap 'M' again to get full details without scrambles(suitable for big average attempts) so that you can copy them or whatsoever(only applicable in browsers other than IE too)
    - click on the best/worst time(on the right side) or press 'Z' or 'X' to get the scramble for the relative scrambles
    - click on the best/worst average of 5/12 time or press 'C', 'V', 'B', or 'N' to get the details so that you can copy them or whatsoever(only applicable in browsers other than IE too)
    - click on the box displaying all the times to select and highlight all the texts, and press [CTRL]+[C] to copy them to the clipboard(after a box appears)(only applicable in non IE environment)
    - If you really want it to be more "full screen" instead of seeing the navigation bars and title bars, press [F11]. If your browser supports full screen mode, the whole window will fill the screen.
    Note: Google Chrome encouraged. IE disencouraged.


    Previews:

    Starting...

    DNF function(forgot to show +2 penalty function), bracket best and worst time function, time of solve, number of solves, mean, average, standard deviation, current, best and worst average of 5 and 12.

    In 3x3 Blindfolded mode. Display of memorization and execution time seperately, current time and date, full screen mode after clicking the time, position of scramble in full screen mode

    Details of times after clicking on the mean time.

    OLL, PLL and LL skip function, percentage of skips and DNFs, times for best average of 12 shown(click on the red 'X' to close the details box).

    2x2 in blindfolded mode in non-full screen mode, scramble preview drag function.
    Last edited by K073; 11-26-2009 at 07:40 AM.

  2. #2
    Member Edward's Avatar
    Join Date
    Oct 2009
    Location
    Your default internet browser
    WCA Profile
    2011KING01
    YouTube
    twistnturn44
    Posts
    2,508

    Default

    Another one? So many timers.

  3. #3

    Default

    last time I was just modifying the timer to suite my style. Now, since I made many changes, I'll just upload it and share with all the cubers.

  4. #4
    Premium Member Cride5's Avatar
    Join Date
    Jan 2009
    Location
    Scotland
    WCA Profile
    2009RIDE01
    Posts
    1,195

    Default

    Nice!

    If you could add in a <25 move random-state scrambler for 3x3 I'd be sold

    EDIT: There's a bit of a bug with resizing the window in Firefox/Linux. The main timer disappears!
    EDIT2: What's happening is when the window is reduced in size, no scroll bar appears. Pressing spacebar causes it to scroll to the bottom which hides the timer at the top. With no scroll bars there's no way to see the timer again, unless the window can be increased in size.

    @ ShadenSmith (post below), are you talking about the bug where if you stop the timer and continue to hold it, the timer starts again when you let go? This is deffo another bug :/
    Last edited by Cride5; 11-12-2009 at 08:57 AM.
    3x3(ZZ): a12 16.73, pb 11.22 nl | 2x2(Guimond): a12 5.27, pb 3.40 nl | FM a12 30.1, pb 21
    Or you can just use the Wiki .. or cTimer .. or VisualCube

  5. #5
    Member ShadenSmith's Avatar
    Join Date
    Jan 2008
    Location
    Lexington, Kentucky
    WCA Profile
    2008SMIT01
    Posts
    1,009

    Default

    Hold the spacebar down.
    Chestie is my bestie. Check out KOII.

  6. #6

    Default

    random state scrambler would be too much for JavaScript.
    the spacebar issue is a must because if not, when you hit the spacebar to stop the timer, and release immediately, the timer starts again.
    I set the window to be opened in a pop up in full screen, why would you resize it?? just maximize the window and everything will be fine.
    this timer is set to detect screen size and resize all element according to ratio given, so all the things will be crappy when you resize the window. that's the main reason I set it to pop a full screen window out.

  7. #7
    Premium Member Cride5's Avatar
    Join Date
    Jan 2009
    Location
    Scotland
    WCA Profile
    2009RIDE01
    Posts
    1,195

    Default

    Quote Originally Posted by K073 View Post
    random state scrambler would be too much for JavaScript.
    I don't think so. Not if move-count isn't a concern. Optimal random-state is deffo a bit of an ask, but something like Thistlethwaite certainly is not. The challenge is to have something which can generate scrambles of under 25 moves. I've already tried implementing the Kociemba 2-phase algorithm in js, but the memory consumption was too high - this is mainly because js doesn't offer good enough type control to store pruning tables efficiently. This could potentially be overcome by using bitwise operations to pack more data into 32-bit integers, but is a major faff!

    With regards to resizing, if you want a program to be nice for its users its good to be flexible. Its perfectly reasonable to assume that folk may wish to have multiple windows open at once, or may be even working on a 640x480 display. Even if it can't show all elements, it should at least degrade in a reasonable manner. I personally use this scrambler along-side my timer..
    3x3(ZZ): a12 16.73, pb 11.22 nl | 2x2(Guimond): a12 5.27, pb 3.40 nl | FM a12 30.1, pb 21
    Or you can just use the Wiki .. or cTimer .. or VisualCube

  8. #8

    Default

    Quote Originally Posted by Cride5 View Post
    I've already tried implementing the Kociemba 2-phase algorithm in js, but the memory consumption was too high - this is mainly because js doesn't offer good enough type control to store pruning tables efficiently.
    I came to the same conclusion a while ago. Even if it could be optimized enough to run acceptably on the best JS engines, it wouldn't work for people using older/worse browsers.

    Quote Originally Posted by Cride5 View Post
    This could potentially be overcome by using bitwise operations to pack more data into 32-bit integers, but is a major faff!
    Bitwise operations in JavaScript are *evil*! The language doesn't have an integer type - all numbers are double-precision (64-bit) floating point numbers. The bitwise operators convert their operands to integers, do their thing, then convert the result to floating point. They are quite unpredictable and rarely a good idea for anything.

    Besides, all values are boxed (on most implementations) and an array of them takes much more space than needed. One way to store large tables could be to use a string, but I haven't tried it.

    I think it would be fine to use an efficient program on the server and request new scrambles using AJAX when needed. If that annoys some people, you could print some (say, 100 or 1000) new scrambles in a JS array every time the page is loaded and only start making requests when those have been used.

    Quote Originally Posted by Cride5 View Post
    With regards to resizing, if you want a program to be nice for its users its good to be flexible.
    Definitely agreed.
    Last edited by Johannes91; 11-13-2009 at 06:09 AM. Reason: blablabla bitwise blablabla

  9. #9
    Premium Member Cride5's Avatar
    Join Date
    Jan 2009
    Location
    Scotland
    WCA Profile
    2009RIDE01
    Posts
    1,195

    Default

    Quote Originally Posted by Johannes91 View Post
    Bitwise operations in JavaScript are *evil*! The language doesn't have an integer type - all numbers are double-precision (64-bit) floating point numbers. The bitwise operators convert their operands to integers, do their thing, then convert the result to floating point. They are quite unpredictable and rarely a good idea for anything.
    Damn I didn't realise that I assumed it did the same thing as other weakly typed languages, silently converting between types. Storing everything as 64-bit floats is just ridiculous, especially when bitwise operations insist on shrinking them to 32-bit ints. It basically means you can't do anything with bitwise operations unless you are happy to waste 32 bits! That is a serious flaw

    Storing cube state in strings sounds like a good idea. It will reduce the memory footprint 4-fold (and possibly further if used in conjunction with bitwise operations), but at the same time will increase the overhead of read/writes. It may be worth it tho..
    ... thx for the pointer
    Last edited by Cride5; 11-14-2009 at 10:44 AM.
    3x3(ZZ): a12 16.73, pb 11.22 nl | 2x2(Guimond): a12 5.27, pb 3.40 nl | FM a12 30.1, pb 21
    Or you can just use the Wiki .. or cTimer .. or VisualCube

  10. #10

    Default

    Kociemba is written in JAVA not JavaScript! The source of the page is short because it loads Java instead of scripts to be executed by js engines. If I even put a Java applet into my timer, users will have to wait for a day to use my timer because they'll have to install latest Java.
    Even if it doesn't require plugin installation, how am I going to make a Java applet interact with my scripts so that the script an fetch and save all the scrambles

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •