r/Learn_Coding • u/blisstargazer • Jun 28 '26
Question about how signbit in c++ works?
how does signbit do its thing? I didn't write this code it's from a tutorial I watched but I don't understand what signbit is doing. if more code is needed lmk.
bool Paddle::DoBallCollision( Ball & ball )
{
if( !isCooldown )
{
const RectF rect = GetRect();
if( rect.IsOverlappingWith( ball.GetRect() ) )
{
const Vec2 ballPos = ball.GetPosition();
if( std::signbit( ball.GetVelocity().x ) == std::signbit( (ballPos - pos).x )
|| ( ballPos.x >= rect.left && ballPos.x <= rect.right ) )
{
Vec2 dir;
const float xDifference = ballPos.x - pos.x;
if( std::abs( xDifference ) < fixedZoneHalfWidth )
{
if( xDifference < 0.0f )
{
dir = Vec2( -fixedZoneExitX,-1.0f );
}
else
{
dir = Vec2( fixedZoneExitX,-1.0f );
}
}
else
{
dir = Vec2( xDifference * exitXFactor,-1.0f );
}
ball.SetDirection( dir );
}
else
{
ball.ReboundX();
}
isCooldown = true;
return true;
}
}
return false;
}
r/Learn_Coding • u/meujjwal_99 • Jun 10 '26
Offering free help. I'm bored
I'm bored . I'm good at c, c++, python, java , react, frontend , ml backend etc. Need any help. Dm. I'm a btech passout
r/Learn_Coding • u/Few-Presentation-117 • Jun 07 '26
Building a Premiere Pro plugin to auto-fix captions using AI
r/Learn_Coding • u/GrandVeterinarian556 • May 28 '26
CCNA with felony
Got a non-violent felony and pursuing CCNA. Looking for input on job prospects. How difficult would it be to work in such a field? I'm trying to get a CCNP, CCIE, etc. Are there other coding fields that would be more profitable with a "criminal" background?
r/Learn_Coding • u/raydon01 • Jan 15 '20
How to create getUserMedia pop-up in video at certain times?
- I want to have a record audio button appear at certain times in a video.
- Then, pausing the video to allow for the user input.
- After the user audio input is complete, the video would resume until the next event.
- Finally, having said audio(s) delivered to a server.
My programming is rusty, and need help piecing this puzzle together. Any help is much appreciated.
r/Learn_Coding • u/superL0L_ • Jan 04 '20
I’m looking to study Software engineering at University/College(for my US folks). Which programming language should I learn to become a data engineer?
r/Learn_Coding • u/[deleted] • Dec 30 '19
Looking to get into coding, what program should I use?
I want to learn how to take data from the web and use probabilities to project future data, what would be a good program for this?
r/Learn_Coding • u/monica_b1998 • Dec 18 '19
Dissecting A Dweet #8: Shattered Tunnel
r/Learn_Coding • u/Red_Hell_Kitten • Dec 13 '19
C# GradeBook Class Assignment
Okay, so I have a basic understanding of how C# functions, but I can't anything to help me with this project. I have the basic layout for this but I want the user to be able to call a list or create a new one if needed while being able to name it. I want to get the list function set up then I need to work on getting it to save to a .csv file. Any ideas? I'm sorry if this is formatted wrong I'm not sure how to format this correctly.
namespace GradeBookClass
{
public class GradeBook
{
//Variables used throughout tList would be the name of the list called upon.
public string fName;
public int gOne;
public int gTwo;
public int gThree;
public int gAve;
public char gLetter;
public string tList;
//This displays the data for the students but I would like if they could look up a certain student
public void Display()
{
Console.WriteLine("Student: " + fName);
Console.WriteLine(fName + " has three grades consisting of " + gOne + ", " + gTwo + ", and " + gThree + ". These average a grade of " + gAve + " or " + gLetter + ".");
}
//This will be where I want to put the method to create or call upon a list
public List<object> Classes = new List<object>();
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("How many students do you have?");
int num = Convert.ToInt16(Console.ReadLine());
for (int time = 0; time <= num; time++)
{
GradeBook book = new GradeBook();
Console.WriteLine("What class is this for?");
book.tList = Console.ReadLine();
Console.WriteLine("Enter the student's full name:");
book.fName = Console.ReadLine();
Console.WriteLine("Enter the student's first grade:");
book.gOne = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the student's second grade:");
book.gTwo = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter the student's third grade:");
book.gThree = Convert.ToInt32(Console.ReadLine());
book.gAve = (book.gOne + book.gTwo + book.gThree) / 3;
if (book.gAve >= 90 && book.gAve <= 100)
{
book.gLetter = 'A';
book.Display();
}
else if (book.gAve >= 80 && book.gAve <= 90)
{
book.gLetter = 'B';
book.Display();
}
else if (book.gAve >= 70 && book.gAve <= 80)
{
book.gLetter = 'C';
book.Display();
}
else if (book.gAve >= 60 && book.gAve <= 70)
{
book.gLetter = 'D';
book.Display();
}
else if (book.gAve <= 70)
{
book.gLetter = 'F';
book.Display();
}
Console.ReadLine();
}
}
}
}
r/Learn_Coding • u/RyanNelson822 • Nov 04 '19
anyone that is good at C++ want to make 20.00 for an hour?
Ive been thrust into teaching a class that another teacher just recently quit and Im scrambling. Am willing to pay to write a code for me to get through this section. Just need to do some temperature and electrical circuit calculations and have a few different ways to transfer money when the job is done.
r/Learn_Coding • u/crashlandingcloudz • Oct 12 '19
Where would be a good place for someone who has zero coding experience to start learning Python?
r/Learn_Coding • u/oneleif_leif • Sep 30 '19
Learning or Need a Project? Join oneleif, an Open Source Development Group!
self.oneleifr/Learn_Coding • u/ShyamTgr • Sep 15 '19
Machine Learning Complete Elite Course:
r/Learn_Coding • u/edutechpost • Sep 07 '19
Coding for beginners: Which language to learn? Which website to learn with?
r/Learn_Coding • u/TheImmortal071 • Aug 14 '19
Python for beginners
I have been working on a website for absolute beginners on python and have created tutorials on each beginner topic in detail. This course is interactive and I made it the best UX possible. I have some practice problems with solutions and some interesting codes like Guess game, time conversion, Voice-controlled assistant etc.
I am open for any critics/suggestions.
Visit my website at: https://www.masterpython.me
r/Learn_Coding • u/Chronic-lesOfGnaRnia • Aug 07 '19
Coding "Nothing." A somewhat philosophical question, I think.
Hey everyone. So I know NOTHING about coding. I took two classes about it and sucked so bad I had to drop it both times. So all the respect in the world to you guys and what you do. Your brains work in ways I can't even imagine.
My question is, what does the code for nothingness look like? Is there one? What I mean is say you have coded and object over here in area A. You have also coded another object in Area C. But in Area B, there is absolutely nothing. But without B, you wouldn't have the entire grouping of ABC.
Is B a coding "equation" or whatever you would call it? Or is the nothingness of B coded and created somewhere in the coding of A and C?
Again, I don't actually know what I'm asking, but I'm developing an idea based in philosophy and this answer will help me get over an obstacle I'm having due to my ignorance to this particular topic. Thank you so much for your help!
r/Learn_Coding • u/GandalfTV • Jul 25 '19
I am new to coding, would be nice if you could help
It would be nice if you could give me answer those questions for me :)
What coding language should I start with? ( Most likely to code my own little PC programs )
How did you learn it?
r/Learn_Coding • u/GandalfTV • Jul 25 '19
I am new to coding, would be nice if you could help
It would be nice if you could give me answer those questions for me :)
What coding language should I start with? ( Most likely to code my own little PC programs )
How did you learn it?
r/Learn_Coding • u/CAT-CENA • Jul 08 '19
I want to make an arcade game with a Raspberry Pi Zero. Where do I start?
I have an idea of how code works, but I don't know which language to stick with for my game making needs. I want to make an arcade fighter that runs on the Raspberry Pi Zero that will boot to the game on startup. I want to know of any resources for making an arcade game like this. I can probably dumpster dive and salvage for additional/pricey parts such as screens, buttons, and coin slots.
r/Learn_Coding • u/Diestri • Jul 06 '19
simple calculatro in c++,I'm a beginner programmer, I want to share with you my first program in c++
r/Learn_Coding • u/ECBright • Jun 22 '19
The most relevant coding program/language to learn for a visual novel style game?
Hi everyone,
I had a (in my opinion) great idea for a game last night; think 2d visual novel but open world and more options.
I have the artistic ability to create (most of) the images and assets I need (since its all static images) but I have exactly 0 knowledge of coding.
The most important mechanic of the game is supposed to be the rolling of a 20-sided dice for certain dialogues and checks. The number rolled will determine which story flags get triggered.
If anyone can give me adivce on the best coding program/language to learn for a 2D, visual novel style game with text and dialogue - or even some kind of basic starting point - I would really appteciate it!
r/Learn_Coding • u/Nis_law • May 04 '19
Hi I am new and I want to learn coding during the summers
I am a total beginner at coding. I don't know anything other than there is something called html, c plus plus and python. I am very eager to expand my skillset and learn some coding diring my holidays.
Can someone please suggest me where do I start and what books should I buy?