ELI5: Why does the random output once but TIME fixes it

>The examples above just outputs a random number once. They don't output different random numbers each time the program runs. To fix this, you can use the srand() function and add the time() function from the <ctime> library. ~ W3School

>
Generally speaking, the pseudo-random number generator should only be seeded once, before any calls to rand(), at the start of the program. It should not be repeatedly seeded, or reseeded every time you wish to generate a new batch of pseudo-random numbers. Standard practice is to use the result of a call to std::time(0) as the seed. However, std::time returns a std::time_t value, and std::time_t is not guaranteed to be an integral type. ~ cppReference

I do not understand why time changes it and I do not understand the seed and what it is

reddit.com
u/TheEyebal — 4 days ago

#THE UNEMPLOYED CHALLENGE

I’m starting a YouTube series called CHAPTERS, where I’ll share a day-in-the-life video every Friday and document this chapter of my life as it happens.

No pretending I have everything figured out—just the real ups, downs, routines, and lessons along the way.

What would you want to see in a series like this?

reddit.com
u/TheEyebal — 8 days ago

#THE UNEMPLOYED CHALLENGE

I’m starting a YouTube series called CHAPTERS, where I’ll share a day-in-the-life video every Friday and document this chapter of my life as it happens.

No pretending I have everything figured out—just the real ups, downs, routines, and lessons along the way.

What would you want to see in a series like this?

https://www.youtube.com/channel/UC176tEeAC8iUvt6epZgnV0Q

u/TheEyebal — 8 days ago

#THE UNEMPLOYED CHALLENGE

I’m starting a YouTube series called CHAPTERS, where I’ll share a day-in-the-life video every Friday and document this chapter of my life as it happens.

No pretending I have everything figured out—just the real ups, downs, routines, and lessons along the way.

What would you want to see in a series like this?

reddit.com
u/TheEyebal — 8 days ago
▲ 4 r/raylib

ELI5: What is the different between camera target and offset?

I am using raylib and have applied and tested out, but I am still confused.

reddit.com
u/TheEyebal — 10 days ago
▲ 21 r/cpp_questions+1 crossposts

Why is my conditional statement running when the condition it is not True

I am making a ball fall in the CLI. I have my values PURPOSELY set to negative for testing purposes and whenever I run it, the conditional statement is active and it does not start at the initial y position I have set. it shows something big in the terminal Falling 2144211756.

When I put it in the debugger it works normally and it shows the y position decreasing so why is it doing this

struct Ball {
    // int x_pos;
    int y_pos;
    int velocity;
    int ground;
};

int main() {
    // Define Ball object with struct
    Ball ball;
    ball.y_pos = 20;
    ball.velocity = 5;
    ball.ground = 200;

    while (true) {
        ball.y_pos = ball.y_pos - ball.velocity;

        if (ball.y_pos &gt;= ball.ground) {
            cout &lt;&lt; "Falling ";
            cout &lt;&lt; ball.y_pos &lt;&lt; endl;
            // exit(0);
        }
    }

    return 0;
}

https://imgur.com/a/oVZ8qhY

u/TheEyebal — 11 days ago
▲ 50 r/vim

how do you copy text from one document and paste it into another in vim?

I’m working with two files, File A and File B, and I want to copy text from one file to the other.

Specifically, I want to:

  1. Open File A and select/yank a section of text.
  2. Switch to File B.
  3. Paste the yanked text into File B.

What is the correct way to yank text from File A and paste it into File B? Is there a specific register or command I should use to copy text between separate files?

reddit.com
u/TheEyebal — 13 days ago

Am I stupid for doing open source?

I am reading open source code from pygame-ce when I have 2 year python experience and do not know C.

I chose pygame-ce because I use it a lot for games I build and I enjoy using it

EDIT : my question for context is, am I skilled enough to be working on the pygame-ce open source project and should I do it?

reddit.com
u/TheEyebal — 13 days ago
▲ 1 r/pygame

How are you executing your programs mac/linux/window users

I used pyinstaller and it says it is missing certain files and when I was able to get it to work it just showed a TXT file full of gibberish.

How are y'all executing

BTW I am using a text editor to code not an IDE

EDIT: I meant how are you turning your python file into an executable file

reddit.com
u/TheEyebal — 16 days ago
▲ 29 r/pygame

You Are Your Own Worst Enemy

iade a game in pygame that also involves camera detection where you have to control the object using hand gestures.

I did it for a game jam where the theme was psionic.

So i wanted it to be like telekinesis

It is a bit buggy and I still have a lot to work on but I learned a lot within the 3 days

u/TheEyebal — 17 days ago

What is this issue called in programming

 made a game in pygame but when I tried to run it automatically closed when I did pyinstaller

also I had to add os and sys to my code because it could not find certain files (assets and audio)

i could not use the relative paths

I was lost honestly

I had to ask the AI how to find the certain files because even thought it was in the project folder they were relative

this was the code they gave me which I did not understand

import os
import sys

def resource_path(relative_path):
    try:
        # PyInstaller stores temporary files here when running the .exe
        base_path = sys._MEIPASS
    except AttributeError:
        # Running normally from Python
        base_path = os.path.abspath(".")

    return os.path.join(base_path, relative_path)

what is this called I keep running into this problem and I wanted to know people views on this

I also asked CHATGPT what this issue is called

CHATGPT RESPONSE
What you are running into is usually called deployment issues or packaging issues.
More specifically, for a Pygame project turned into an executable with PyInstaller, the problems you described fall into a few common categories:
Asset path problems — your game works from your development folder, but the packaged .exe cannot find images, sounds, fonts, or other files.
Resource bundling problems — PyInstaller creates an executable, but your external files were not included correctly.
Runtime environment differences — your code is no longer running in the same folder/context as when you launched it with Python.
Relative path issues — paths that work in your IDE or terminal break when the program is moved or packaged.
Executable packaging/debugging issues — the .exe opens and immediately closes because an error happens before the window appears, but the error console disappears.
A lot of beginners hit this when moving from "my program runs on my computer" to "my program is a standalone application." It is a general software development concept: the difference between development environments and production/deployment environments.
The os and sys changes you made are part of a larger concept called resource path handling or runtime path resolution. Games, apps, and tools often need to figure out:
Where is the program running from?
Where are my assets located?
Are my files inside the executable or next to it?
Does this work on another computer?
PyInstaller specifically has its own way of dealing with this, so the issue is not really a "Pygame problem." It is a Python application deployment problem.
The skill you are bumping into is something programmers eventually learn as they move from:
"I wrote a program"
to:
"I shipped a program someone else can run."
That transition involves packaging, file organization, dependencies, installers, configuration files, logging, and handling different machines. It is one of the first real "software engineering" problems people encounter.
reddit.com
u/TheEyebal — 17 days ago
▲ 18 r/pygame

Control movement using hand gestures

I was able to connect opencv and mediapipe to pygame and display a block when hands are shown

u/TheEyebal — 18 days ago

I feel like a programming fraud

I am having to constantly look things up to figure out how to get what I want? I feel like a fraud.
I am honestly trying to resize my camera onto my surface in pygame. I've never done camera stuff before so this is new. I feel like I am not really learning and just copy and pasting at this point

How do go about this?

reddit.com
u/TheEyebal — 20 days ago

I am having to constantly look things up to figure out my programming

I am having to constantly look things up to figure out how to get what I want? I feel like a fraud.
I am honestly trying to resize my camera onto my surface in pygame. I've never done camera stuff before so this is new. I feel like I am not really learning and just copy and pasting at this point

How do go about this?

reddit.com
u/TheEyebal — 20 days ago
▲ 4 r/VoiceActingBeginners+2 crossposts

Is there a man with a British accent?

I am looking for someone who is interested in doing a British accent like in Little Big Planet. it is for a game I am making. Look at my recent posts, and you will get an idea of what the game is about.

  • Must have karma more than 100
  • Account must older than 30 days
  • Must have a discord account
  • Must be willing to have voice chat
  • Must be willing to send audio recording of yourself
u/TheEyebal — 22 days ago

I updated my pixel art

Yesterday, I had posted a picture of my first two sprites and asked for feedback. I have updated the pixel art and here is the updated one.

What are y'all thoughts on it?

u/TheEyebal — 23 days ago
▲ 1 r/itchio

Updated Character of my game

Yesterday, I had posted a picture of my first two sprites and asked for feedback. I have updated the pixel art and here is the updated one.

What are y'all thoughts on it?

Updated Sprite

reddit.com
u/TheEyebal — 23 days ago
▲ 2 r/itchio

Which should I use for the game, RIGHT OR LEFT?

I am new to pixel art and I wanted y'all thoughts on which pixel art should I use for my game project.

Also what changes should I make?

sprite

reddit.com
u/TheEyebal — 24 days ago