Maxtron News, Android KitKat, stock firmware, Flash file, Lava iris, Ulefone Tiger, Mobile App, Marketing Tool, Infinix Stock Roms, Android Multi Tools Latest Version

HOW TO SIMULATE A BOUNCING BALL USING C++

HOW TO SIMULATE A BOUNCING BALL USING C++ - for a long time we built this blog Maxtron News with the intention to advance the knowledge of the community about technological developments that continue to advance, because not everyone can enjoy the technology, so you will we present the technology news according to what you need, now we will discuss first about HOW TO SIMULATE A BOUNCING BALL USING C++ please refer to the information we provide we feel quite complete because we summarize from reliable sources.

Articles : HOW TO SIMULATE A BOUNCING BALL USING C++
full Link : HOW TO SIMULATE A BOUNCING BALL USING C++
Article C++, Article How to, Article programming,

You can also see our article on:


HOW TO SIMULATE A BOUNCING BALL USING C++

HEllo!!
Bouncing ball simulation is really interesting in C++. It uses the header file <graphics.h> for drawing the ball, and here we also use http://katieandmaxtron.blogspot.com /2013/05/using-delay-function-in-c.html">the delay function for displaying the ball in different places.
The header files used : < graphics.h> , <stdio.h>, <conio.h> , <iostream.h>, <dos.h>, <stdlib.h>
the source code is not that hard to understand if you know how to use graphics in C++.
Otherwise it's a little complicated, again 'copy-paste'.


here is the source code:

#include<stdio.h>
#include<iostream.h>
#include<graphics.h>
#include<conio.h>
#include<stdlib.h>
#include<dos.h>
int n = 200,x = 50, y = 50, r=30;
void move()
{
setcolor(GREEN);
circle(x,y,r);
delay(70);
setcolor(BLACK);
setfillstyle(1,BLACK);
circle(x,y,r);
floodfill(x,y,BLACK);
delay(50);
putpixel(x,y,8);
return;
}
void main()
{
int gd=DETECT,gm;
initgraph(&gd,&gm,"c:\tc\BGI");
while(n>0)
{
while(y<450)
{
move();
y = y+25;
x=x+5;
putpixel(x,y,8);
} while (y>n)
{ move();
y=y-25;
x=x+5;
putpixel(x,y,8);
} n=n+50;
}setcolor(GREEN);
circle(x,y,r);
getch();
closegraph();
}
view raw gistfile1.cpp hosted with ❤ by GitHub


That's it, there is nothing you can do in this simulator, other than watching it bounce.

Thank you
cheers !!
keep coding..





just so much information HOW TO SIMULATE A BOUNCING BALL USING C++

hopefully the article that we make this HOW TO SIMULATE A BOUNCING BALL USING C++ can be useful for you in adding science about gadgets that continue to advance.

you just read the article with title HOW TO SIMULATE A BOUNCING BALL USING C++ if you wish to bookmark or share it please use link https://katieandmaxtron.blogspot.com/2013/05/how-to-simulate-bouncing-ball-using-c.html to get more information please visit our other blog page.

Tag : , , ,
Share on Facebook
Share on Twitter
Share on Google+

Related : HOW TO SIMULATE A BOUNCING BALL USING C++

0 komentar:

Posting Komentar