Coding Journal

Jordan Vidrine

Daily Coding Journal

An experienced business owner + musician with a demonstrated history of management in the Energy sector and an insatiable appetite for learning new and complex skills. Transitioning from an ownership role & seeking employment in Web Development as a Jr Full Stack Developer.

June 10th 2019

Man, is this year flying by! I’ve got to put some time into my artspark project so this week will be a slow one for me coding-wise. This morning I wrote a little script to help my wife pick a winner for a drawing she did with her business. We had 266 email submissions as well as another 50+ Facebook & Instagram submissions.

I used a CSV to JSON converter to parse through the email list and convert that into an array of names. We then added to that array by using a simple html input I made. We entered the user name, and the amount of submission, and the submit button would push that (x) amount of times into the array of submits.

I then picked a random user from the array with the simpleMath.floor(Math.random()*array.length)

I also updated the styling of my calculator app, and reformatted my LinkedIn profile and resume to reflect my current career path.

Calculator update

Got to work on this for awhile tonight and encountered multiple bugs. Pressing “=” when current input or formula evaluated to 0 resulted in NaN. I fixed that. I am also implementing the ability to more intelligently use the decimal place. In the past I treated it as an operator and would not allow it after a regular operator symbol.

Now pressing “.” after an operator will cause the formula to be built like such “4 + 0.” or “4 x 0.” and it will wait for the next number input to decide what the fractioned number should be.

Other Issues I need to work on:

  1. Need to STOP the entering of multiple decimals in a number
  2. Need to add “0.” to formula and current input when “.” is pressed for the first time after “=” or operator
  3. Need to stop number from getting too large for its Screen
  4. An operator should not be able to be entered right after a “.” press
Back to blog...