Now I'll teach you how to use graphics in turbo c...
First You have to open it up go to OPTIONS -> LINKER -> CLICK THE GRAPHICS YOU SHOULD see a mark x
look for the BGI folder in TURBO C then copy all of its content... to BIN
now we are ready to use the graphics library of the turbo c... I'll teach you some reserved words in graphics
cleardevice(); // is the clrscr() of the graphics mode...
outtextxy(); // works like printf ex. outextxy(100,100"Louie"); can only print string...
getmaxx(); // returns the maximum x pixel of the screen
getmaxy(); // returns the maximum y pixel of the screen
setcolor(); // sets the color of the next text; LIGHTBLUE search in google for values can be integer 0-14
settextstyle(); // sets the style of the next text ex. settextstyle(2,HORIZ_DIR,4); params font,direction,size
settextjustify();
Sunday, August 15, 2010
Moving car simulation... in TURBO C...
Last week I said that I will teach you How to use SSLAM in improving your coding/programming logic... Now here it is... 10 mins of reading can change your programming perspective...
first you have to download borland C++ to start... you can search it in google...
create a function name printLane(int x,int y); put your code in here...
Imagine this is your screen in console mode... the x (left to right) has a total of 79 characters and y (top to bottom) has 24 characters...
print a line on 0,0 (x,y)
printf("-------------------------------------------------------"); ( this is a line )
then type gotoxy(0,3) to go to the third line then print another line
printf("- - - - - - - - - - - - - -"); ( this is a line )
then type gotoxy(0,6) to go to the sixth line then print another line
printf("-------------------------------------------------------"); ( this is a line )
compile it then run it... you have to call it of course in console mode it should look like this...
--------------------------------------------------------------
- - - - - - - - - - - - - - - -
--------------------------------------------------------------
The code looks like this...
#include <stdio.h>
#include <conio.h>
void printLane(int x, int y){
clrscr();
gotoxy(x,y);
printf("-------------------------------------------------------");
gotoxy(x,y+3)
printf("- - - - - - - - - - - - - -");
gotoxy(x,y+6)
printf("-------------------------------------------------------");
}void main(){
printLane(0,0);
getch();
}Saturday, August 14, 2010
First Year, First Defense, First Case... First Time...
Earlier I remembered the first defense we had way back first year its not the first formal but we still had to defend it so... I guess its the first... Luckily I managed to find the source code and took a couple of pictures of it. The first case study was the ROCK, PAPER, SCISSOR GAME...
This is the original Copy of our first case study in programming 1. This is the front page it has the name of our teacher Mam Lydinar Dastas, and the name of my co-workers Paul Pajares and Mary Grace Canlas who were my groupmates back then...
This is the original Copy of our first case study in programming 1. This is the front page it has the name of our teacher Mam Lydinar Dastas, and the name of my co-workers Paul Pajares and Mary Grace Canlas who were my groupmates back then...
Subscribe to:
Comments (Atom)