# UTimer released!



## United Thought (Aug 12, 2015)

This is a very compact, very basic timer website written in JS. I want this to be an exercise firstly for me to improve my skills in web programming, and secondly where, starting with a basic shell of a timer, the community requests what features they would like, the end product being a timer with no superfluous functionality.

Please could anyone knowledgeable on the subject provide me with advice/explanations on certain features and how I could improve my code more generally.

UTimer v1.1.0:

link to site: http://www.utimer.site40.net/main.html
link to source: [main.html]
---------------: [main.js]
size: 7.17KB

*Implemented features:
*
-Scramble generation (333 only).
-Scramble generation now prevents consecutive moves on the same axis.
-PBs and Averages just for the current session + time display and reset function.
-Solve timer.
*
Partly implemented features:
*
-Inspection time(runs infinitely atm).

*Features in progress:
*
-None

*Requested features:
*
-Account system/time log + comparison with other users.

All help/advice/critiscism is greatly appreciated!


----------



## adimare (Aug 12, 2015)

Scramble generated with your code: R U D' D' B' D D2 L U U' B F2 F L2 B2 U' B2 R U' R2 B D2 L2 B B2

If this is a programming exercise for yourself the scrambling code needs a lot of improving, if you care more about the actual result I'd suggest using https://github.com/cubing/jsss for scrambles.


----------



## United Thought (Aug 12, 2015)

adimare said:


> Scramble generated with your code: R U D' D' B' D D2 L U U' B F2 F L2 B2 U' B2 R U' R2 B D2 L2 B B2
> 
> If this is a programming exercise for yourself the scrambling code needs a lot of improving, if you care more about the actual result I'd suggest using https://github.com/cubing/jsss for scrambles.



Thanks! Yeah, the original code was useless.
The new code now prevents consecutive moves. Yes, this is an exercise for myself so any further tips would be greatly appreciated!


----------



## mDiPalma (Aug 12, 2015)

In my opinion, if you're not doing random state scrambles, you should also prevent or concatenate sequences like U D' U2. I believe there are many ways to do this.


----------



## United Thought (Aug 13, 2015)

Good news! The website is now live and functional at http://www.utimer.site40.net/main.html!


----------



## Renslay (Aug 13, 2015)

mDiPalma said:


> In my opinion, if you're not doing random state scrambles, you should also prevent or concatenate sequences like U D' U2. I believe there are many ways to do this.





United Thought said:


> Good news! The website is now live and functional at http://www.utimer.site40.net/main.html!



Agreed. I just got this scramble:

U2 D2 F' D' F2 R2 L2 D' L' U' R2 U2 R' F2 L2 F' D2 L2 D2 L2 *D2 U2 D2 U2* D2

If the current random turn is on the same axis as the previous turn, than the next turn cannot be from that axis. Something like that.


----------



## United Thought (Aug 13, 2015)

mDiPalma said:


> In my opinion, if you're not doing random state scrambles, you should also prevent or concatenate sequences like U D' U2. I believe there are many ways to do this.





Renslay said:


> Agreed. I just got this scramble:
> 
> U2 D2 F' D' F2 R2 L2 D' L' U' R2 U2 R' F2 L2 F' D2 L2 D2 L2 *D2 U2 D2 U2* D2



Ok, I will start working on preventing these trivial cancellations.

E: The scrambler code has now been changed to prevent consecutive moves on the same axis.


----------



## mDiPalma (Aug 13, 2015)

averages (5/12/100)? PBs (1/5/12/100)? 

if this is just an exercise for web-programming, you could also make a way for users (with accounts) to save their times and compare with others (if your host allows PHP, etc...). That would be pretty cool and really simple to code.

in my opinion, let us know if you need guidance


----------



## United Thought (Aug 13, 2015)

mDiPalma said:


> averages (5/12/100)? PBs (1/5/12/100)?



I will start working on this.



mDiPalma said:


> averages (5/12/100)? PBs (1/5/12/100)?
> 
> if this is just an exercise for web-programming, you could also make a way for users (with accounts) to save their times and compare with others (if your host allows PHP, etc...). That would be pretty cool and really simple to code.
> 
> in my opinion, let us know if you need guidance



I think the host does allow PHP, but that's about it. (That's what you get with a free host)

I have never used PHP for anything before, so I will have a lot to learn but I think I will leave implementing this feature until later. Thanks for the offer of advice as well! I will tell you if I have any major issues.


----------



## molarmanful (Sep 4, 2015)

United Thought said:


> I will start working on this.
> 
> 
> 
> ...


Bump. You can use localStorage or (not recommended) cookies to store times, if you want to stick with JS.


----------

