Search found 5 matches
- June 24th, 2020, 10:31 pm
- Forum: Everything
- Topic: cant make a for loop without declaring beforehand the variable i am using as the counter
- Replies: 2
- Views: 1887
- June 24th, 2020, 2:57 pm
- Forum: Everything
- Topic: cant make a for loop without declaring beforehand the variable i am using as the counter
- Replies: 2
- Views: 1887
cant make a for loop without declaring beforehand the variable i am using as the counter
so i know i have a lot to learn but its really pissing me of that i cant make a for loop like this run for(i == 0;i < n; i ++){ gfx.PutPixel(x + n, y, Colors::Blue); } but if i do like this it works int i; for(i == 0;i < n; i ++){ gfx.PutPixel(x + n, y, Colors::Blue); } as far as i know i shoudnt ne...
- May 5th, 2020, 4:47 pm
- Forum: Everything
- Topic: Beginner C++ (noob alert)
- Replies: 4
- Views: 2289
Re: Beginner C++ (noob alert)
one more thing, i then made another function to draw rectangles just by calling the DrawHorizontalLine (i named it DrawHLine) several times like that void DrawFRetangulo(int x_, int y_, int length_, int hight_, Color color_); the only thing new its that now we need a hight to say how many times Draw...
- May 5th, 2020, 4:14 pm
- Forum: Everything
- Topic: Beginner C++ (noob alert)
- Replies: 4
- Views: 2289
Re: Beginner C++ (noob alert)
From the looks of it, this code should work just fine assuming that nline and y are valid numbers between 0 and Graphics::ScreenHeight and n and x are valid numbers between 0 and Graphics::ScreenWidth. Here's how I would code it just for comparison: Since it's a graphics function, I'd declare it in...
- May 4th, 2020, 11:48 pm
- Forum: Everything
- Topic: Beginner C++ (noob alert)
- Replies: 4
- Views: 2289
Beginner C++ (noob alert)
so i started the beginner c++ series and i was trying to create a function to drawn a line of pixels, i am using the chili framework btw so i declared the function like that void ImageLine(int n, int x, int y, int c1, int c2, int c3); and defined it like that void Game::ImageLine(int n, int x, int y...