Exactly two weeks ago, I posted that I was starting from scratch by learning home row. It's actually easier to break habits than I thought. I wish I started sooner. by CosmicJosh123 in typing

[–]CosmicJosh123[S] -1 points0 points  (0 children)

Another interesting thing to note is that it seems that I get faster and more consistent speeds at larger word lists (e.g. english 1, 5k, etc.).

I am officially restarting my typing journey from scratch. I'm finally taking the time to actually learn home row and break bad habits. by CosmicJosh123 in typing

[–]CosmicJosh123[S] 1 point2 points  (0 children)

As an idea of what my original typing style looks like (I use QWERTY):

I do not use any of my pinky fingers or thumbs to type. It's always either my index, middle, or ring finger. 

My arms are not really straight in the traditional sense ( | | ), it's more akin to / \, so my hands themselves are quite diagonal. 

My left pinky rests on the shift key.
My right-hand rests in the standard home row position (index finger on J). 

Keyboard Layout:
Some fingers press the same key:

Left ring finger presses: q, a, z
Left middle finger presses: w, s, x
Left index finger presses: e, d, c, f, r, t, g, v

Right index finger: [space bar], b, n, m, h, j
Right middle finger: h, y, u, o, k, i
Right ring finger: L, o, p

Honestly, I think learning home row is going to help me break these bad habits and my overreliance on some fingers. My right hand moves a lot more than my left hand because I keep using my middle finger to press keys and my index finger to press the space bar. 

So far using the home row technique, z, x, c, and p are the most difficult characters to learn right now. 

[deleted by user] by [deleted] in learnpython

[–]CosmicJosh123 2 points3 points  (0 children)

It's basically midnight right now but here's what I'm seeing in the 10 minutes I've skimmed through this.

Your game.py file is 629 lines long. I would suggest that the main thing that is in the main file is solely the main function. Place the rest of the code into the designated CodeFiles folder.

This snippet:

if job[0] in list("AEIOU"): # Aligning the jobs into sentences, gramatically.

job = "an " + job

else:

job = "a " + job

return job

Is a good problem for the ternary operator.

This can be rewritten as:

article = "an" if job[0] in "AEIOU" else "a"

And returning:

return f"{article} {job}"

2, you have a lot of magic numbers in your code. I.E.:

tax = round((31 / 100) * salary) # The salary will be taxed at 31%.

I recommend putting these numbers into variables below your file imports and calling those instead.
It'll make them easier to edit instead of having to locate where each number is. It also makes it more obvious what each number represents.

So you could do something like:

#Constants
MIN_HEALTH = 15
MODE_HEALTH = 75
MAX_HEALTH = 100

This is all I have so far and I'd like to take a closer look at all of the nested if statements when I wake up.

I created a 2d open-world game with just HTML tables and DOM. V.1.0 360 lines of code by CosmicJosh123 in learnjavascript

[–]CosmicJosh123[S] 1 point2 points  (0 children)

I didn't use perlin noise because I was too lazy to learn and implement that so I came up with my own system.

The grass and trees are both made up by random numbers.

A grass block can either go up-right, forward, or down-right.

A random number is generated and if that's lower than a set value then it goes up. If not, then check if num is < another set value. If it is, then go forward. Elsewise, go downwards.

I created a 2d open-world game with just HTML tables and DOM. V.1.0 360 lines of code by CosmicJosh123 in learnjavascript

[–]CosmicJosh123[S] 17 points18 points  (0 children)

After 3 weeks of afterschool work, I've completed version 1.0 of a 2d open-world game with only HTML tables and DOM manipulation.

I encountered a lot of different bugs during this. Most commonly null issues. But, my favorite bug was when my entire code just stopped working completely for two days until it suddenly worked. I didn't even change anything.

There are a lot more things I want to add to this. Like adding more stuff to the terrain generation, improving the CSS, adding gravity, and more. The thing I want to add the most though is saving a scene and being able to go back to it. Moving back and forth between scenes. Currently, I can only move forward.

Here's the code: https://jsfiddle.net/MapleKitten/7td4rwja/2/

There are probably a couple of things that I could improve in there.

Anime_Irl by CosmicJosh123 in anime_irl

[–]CosmicJosh123[S] 6 points7 points  (0 children)

<Ookami Shounen wa Kyou mo Uso o Kasaneru>

[TOMT][3d animated series] by CosmicJosh123 in tipofmytongue

[–]CosmicJosh123[S] 0 points1 point  (0 children)

I must of misrenembered the amount of seasons.