Logo

dev-resources.site

for different kinds of informations.

First Update

Published at
8/9/2023
Categories
12months
project
progress
Author
zefur
Categories
3 categories in total
12months
open
project
open
progress
open
Author
5 person written this
zefur
open
First Update

This project is going to force me to come to terms with the meaning of the phrase "Perfect is the enemy of done" because boiii.

So in my mini update I said maybe 2 weeks to get an MVP locally running (not in those exact words but ya) well I definitely over estimated myself, my time and my addiction to trying to solve difficult problems.

First the validation thing that I said I would leave till later, well i couldnt help but keep trying to take a stab at it. Trying to get it working rather than focusing my time else where. I think I am looking for the perfect solution that isnt overly complicated and in JS there isnt an easy way to find it. I think I will do a separate post to rubber duck my problems with what I want and what I have tried.

Second is when you work with ruby on the regular then you move back to JS for a while you get disappointed with the missing methods that are common in ruby. For example I need to make an array of a random selection of values from a much larger array if I was to write this in ruby it would be something like this:

orginal_array = [1,2,3,4,5,6,7,8,9,0]
new_array = original_array.shuffle
new_array.first(4)
Enter fullscreen mode Exit fullscreen mode

or like this

original_array = [1,2,3,4,5,6,7,8,9,0]
new_array = original_array.shuffle.take(8)
Enter fullscreen mode Exit fullscreen mode

or better yet

original_array = [1,2,4,5,6,7,8,9,0]
new_array = original_array.sample(4)
Enter fullscreen mode Exit fullscreen mode

I know they work I just tested them to make sure.

Where as in JS to try and replicate these methods this is what I had to come up with:

$sel = []
let originalArray = [1,2,3,4,5,6,7,8,9,0]
function randomNumbers() {
let temp = []
let pool = []

originArray.forEach((element) => {
      for (let i = 0; i < element[1]; i += 1) {
        pool.push(element[0]);
      }
    });
for (let i = 0; i < 9; i++) {
      // let random = Math.floor(Math.random())

      temp.push(pool[Math.floor(Math.random() * 98)]);
      $sel = temp;
    }
    console.log($sel);
    return;
  }
Enter fullscreen mode Exit fullscreen mode

Note: In my code the originalArray proper length is 98 that is why the random multiplier is so high

Now this definitely could just be a skill issue but from my searching there didn't seem to be a better way to do it (let me know in the comments). Going from Ruby back to this made my already not so fast coding shift down again in gear.

But anyways enough of that lets me just make a note on what I am happy about.

Progress is slow but continuing well. I will be looking at multiplayer within the next couple of days. Timer is done Game start condition is done. Points calculation not yet finished.

progress Article's
30 articles in total
Favicon
Progress Over Perfection: A Year of Progress
Favicon
Simplicity Is An Achievement
Favicon
Software Dev Diary #11 - Progress Report
Favicon
Serverless Doesn't Stand Still
Favicon
The AI Roadmap for 2024: A Year of Transformation and Progress
Favicon
The AI Roadmap for 2024: A Year of Transformation and Progress
Favicon
Add router progress bar in Next Js 14
Favicon
Minimal loader with progress
Favicon
First Update
Favicon
How to add router progress bar in Next Js 13
Favicon
First Post!
Favicon
Project Management
Favicon
Being an AWS CB, what do I get?
Favicon
rich progress and multiprocessing
Favicon
Year in Review 2021 - Google DSC, Microsoft LSA, Accrue Inc πŸ“ΈπŸ’₯
Favicon
HTML tags | progress
Favicon
Page Loading Progress with Next.js and Chakra UI
Favicon
What I've been working onβ€”why I haven't been as active, and what I plan on doing
Favicon
Calculate & Display percentage of progress an upload with React & Axios
Favicon
Why I'm giving Python and Django another chance
Favicon
A Bit of Progress
Favicon
Progress Check: From 1400pts to 77000pts
Favicon
Making a seekable progress component a.k.a slider in Vue.
Favicon
Show waiting users what's happening in the background
Favicon
Settings, settings everywhere
Favicon
KendoReact R2 Webinar 2019
Favicon
KendoReact Components (Functional Hooks Style)
Favicon
Kendo UI R1 Webinar 2019
Favicon
KendoReact R1 Webinar 2019
Favicon
DataDigger 24

Featured ones: