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://faultyaspirations.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:
That's it, there is nothing you can do in this simulator, other than watching it bounce.
Thank you
cheers !!
keep coding..
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://faultyaspirations.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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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(); | |
} |
That's it, there is nothing you can do in this simulator, other than watching it bounce.
Thank you
cheers !!
keep coding..
How to ride. Basic position Sit on the saddle, place the crank on the extension of the saddle pipe, and place the heel on the pedal. If you can straighten your feet in this position, this is where your saddle is. This adjustment is used when pedaling is important.
BalasHapussome time we can use the good things to help others, we can do it, we have the good things,to help others, we can design the large bike saddle bag, this also can as the bicycle saddle bags,we also can use the cycle saddle bag travelaurochs. sometime if we riding others city, we also have the bike seat bags and the bicycle saddle bags waterproof.