Compare commits

...

4 Commits

Author SHA1 Message Date
Sandipan Chatterjee
72d489fdc9 Merge adfe3e074b into 559d03ecf3 2024-02-27 17:12:23 +08:00
Julien Le Coupanec
559d03ecf3 Merge pull request #372 from cunnellp5/cunnellp/vscode/add-command-and-cleanup-spaces
updates vscode cheat sheet
2024-02-26 18:25:32 +01:00
cunnellp5
bea751612a updates vscode cheat sheet with one command 2024-02-15 07:10:18 -07:00
Sandipan Chatterjee
adfe3e074b Added graphical program
Described how to implement the graphics pointer and use it.
2022-10-24 00:28:23 +05:30
2 changed files with 103 additions and 3 deletions

View File

@@ -239,3 +239,102 @@ enum enum_type /* enum_name is optional */
/* use dot notation to select a component of a struct or union */
Graphical enviroment
// Using a graphical program
//Example ------------------------------> Drawing a line
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<graphics.h> // library to use graphical commands
int main()
{
int gd=DETECT,gm; // Initialisation of graphics pointer.
initgraph(&gd,&gm,"c:\\turboc3\\bgi"); // starting the graphical enviroment
int x1,y1,x2,y2;
printf("Enter coordinates of first point");
scanf("%d%d",&x1,&y1);
printf("Enter coordinates of second point");
scanf("%d%d",&x2,&y2);
line( x1 , y1 , x2 , y2 ); // graphics command
closegraph(); // Closing of graphics pointer
return 0;
}
//Example ------------------------------> Drawing a circle
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<graphics.h> // library to use graphical commands
int main()
{
int gd=DETECT,gm; // Initialisation of graphics pointer.
initgraph(&gd,&gm,"c:\\turboc3\\bgi"); // starting the graphical enviroment
int x1,y1,r;
printf("Enter coordinates of center");
scanf("%d%d",&x1,&y1);
printf("Enter size of radius");
scanf("%d",&r);
circle( x1 , y1 , r ); // graphics command
closegraph(); // Closing of graphics pointer
return 0;
}
//Example ------------------------------> Drawing a rectangle
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<graphics.h> // header file to use graphical commands
int main()
{
int gd=DETECT,gm; // initialisation of graphics pointer.
initgraph(&gd,&gm,"c:\\turboc3\\bgi"); // starting the graphical enviroment
int x1,y1,r;
printf("Enter coordinates of first point");
scanf("%d%d",&x1,&y1);
printf("Enter coordinates of second point");
scanf("%d%d",&x2,&y2);
printf("Enter coordinates of third point");
scanf("%d%d",&x3,&y3);
printf("Enter coordinates of forth point");
scanf("%d%d",&x4,&y4);
line( x1 , y1 , x2 , y2 ); // graphics command
line( x2 , y2 , x3 , y3 );
line( x3 , y3 , x4 , y4 );
line( x4 , y4 , x1 , y1 );
closegraph(); // closing of graphics pointer
return 0;
}

View File

@@ -6,7 +6,8 @@
#### General
- `Ctrl`+`Shift`+`P`, `F1`: Show Command Palette
- `Ctrl`+`Shift`+`P`, `F1`: Show Command Palette
- `Ctrl`+`Shift`+`T`: Open last closed tab
- `Ctrl`+`P`: Quick Open, Go to File
- `Ctrl`+`Shift`+`N`: New window/instance
- `Ctrl`+`W`: Close window/instance
@@ -19,7 +20,7 @@
- `Ctrl`+`C`: Copy line (empty selection)
- `Ctrl`+`↓/↑`: Move line down / up
- `Ctrl`+`Shift`+`K`: Delete line
- `Ctrl`+`Enter` / `Ctrl`+`Shift`+`Enter`: Insert line below / above
- `Ctrl`+`Enter` / `Ctrl`+`Shift`+`Enter`: Insert line below / above
- `Ctrl`+`Shift`+`\`: Jump to matching bracket
- `Ctrl`+`]` / `Ctrl`+`[`: Indent / Outdent line
- `Ctrl`+`Home` / `End`: Go to beginning / end of file
@@ -136,7 +137,7 @@
- [`Wrap Console Log`](https://marketplace.visualstudio.com/items?itemName=midnightsyntax.vscode-wrap-console-log): Wrap to console.log by word or selection.
- [`Bracket Pair Colorizer`](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer): Allows matching brackets to be identified with colours.
- [`Bracket Pair Colorizer`](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer): Allows matching brackets to be identified with colours.
## My Settings