Author |
Message |
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
Posted: Sun Dec 24, 2006 11:30 am Post subject: File Creator |
|
|
|
|
I made a simple program but its kind of usefull. You open it up and it and you type in what type of file you you want to create, and it creates that file to desktop..(RTF,CFG,CONF,HTML,INI,HLP) The reason i made this because a long time ago i had a trouble making help file for my zone (f1 function) so i decided to make a quick program that makes some files..I attached the program and the source =D
file maker.rar - 107.37 KB
File downloaded or viewed 31 time(s)
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sun Dec 24, 2006 12:14 pm Post subject: |
|
|
|
|
You really should look into C/C++ tutorials. What IDE are you using, because your executable is a debug-build, which makes it larger than it should be. When publishing any executable or library, use a release build, as the program will be smaller and faster.
A quick look over your code, you never return a value for main(). At the end of the function, because it is of type int, you should return a value. The default would be 0, which generally means the program exited normally.
So far, none of your programs do anything programming related. Look into building a program that calculates quadratic functions. Then try and do one that uses Newton's method to estimate answers to integrals. Look up on Wikipedia to learn programming algorithms to build your own sorting functions, like bubblesort, quicksort, and mergesort. Maybe try and learn a bit about pointers by making your own linked-list class. Then make it doubly linked (can go in reverse). Try a tree structure. Then a hash table.
|
|
Back to top |
|
|
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Sun Dec 24, 2006 12:32 pm Post subject: |
|
|
|
|
Quote: | So far, none of your programs do anything programming related. Look into building a program that calculates quadratic functions. Then try and do one that uses Newton's method to estimate answers to integrals. Look up on Wikipedia to learn programming algorithms to build your own sorting functions, like bubblesort, quicksort, and mergesort. Maybe try and learn a bit about pointers by making your own linked-list class. Then make it doubly linked (can go in reverse). Try a tree structure. Then a hash table. |
I know that stuff is important but that kinda of thing never really simulated me in computing i found it boring. The thing that i enjoy from programming is the creative element. I like the whole creating things.
if you want a more creative challenge, a nice thing to start with is to make a simple game like pong or snake.
Sounds easy, but you can make it more complicated by adding AI for example in pong. Or for example in snake create a number of levels for the snake. On approach to making the level maps would be to create a map editor _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps
|
|
Back to top |
|
|
hellzlaker13213 Guest
Offline
|
Posted: Sun Dec 24, 2006 1:48 pm Post subject: |
|
|
|
|
Lol, it doesnt sound easy making a game snake or pong for me would be hard as f*ck. But its actually a cool idea =D
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Sun Dec 24, 2006 2:52 pm Post subject: |
|
|
|
|
Actually, I agree. I don't profess to have any programming skill, but I DO have a working knowledge of basic C. Actually, I wouldn't even know where to start on Pong, I've never done anything graphical at all. Where do you start for something like that? I could always stand to learn more.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sun Dec 24, 2006 3:06 pm Post subject: |
|
|
|
|
You could either use the Windows GDI (no external libraries required but not the most efficient way to do graphics) or SDL. Both would be very easy, though SDL would require a little more knowledge of C/C++. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
|
|
Back to top |
|
|
SamHughes Server Help Squatter
Joined: Jun 30 2004 Posts: 251 Location: Greenwich Offline
|
Posted: Sun Dec 24, 2006 10:54 pm Post subject: |
|
|
|
|
Mine GO BOOM wrote: | A quick look over your code, you never return a value for main(). At the end of the function, because it is of type int, you should return a value. The default would be 0, which generally means the program exited normally. |
You don't need to explicitly return a value in the main function in C++.
|
|
Back to top |
|
|
hellzlaker Registered Cap Buster Popping men in the ass since Oct 2005
Gender: NEVER ENOUGH! Joined: Oct 27 2005 Posts: 34 Offline
|
|
Back to top |
|
|
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Mon Dec 25, 2006 10:08 am Post subject: |
|
|
|
|
You do know, while (a=1) will set a to 1, then check that it is non zero? I'm assuming you'd actually would have wanted (a == 1). Instead of using a variable, you can just use do {} while (1);
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Tue Dec 26, 2006 10:03 am Post subject: |
|
|
|
|
Cyan~Fire wrote: | You could either use the Windows GDI (no external libraries required but not the most efficient way to do graphics) or SDL. Both would be very easy, though SDL would require a little more knowledge of C/C++. |
You wouldn't necessery even need to use any graphics libraries.
You could create the game using the console.
I've created this example of a ball bouncing around a console. It uses windows API functions. I created it using dev c++.
pong isnt very complex. The basics of pong ( a ball bouncing round a screen are demonstrated below). The trick is to start with something simple and then add to it. To start with i had no idea how to write a ball to the console where i wanted it. But found that out, then i had to work out how to set the screen size and remove the scroll bars. then it was a case of moving the ball, and erasing the trail it left be hind.
#include <windows.h>
int main(int argc, char *argv[ ], char *envp[ ] )
{
COORD ballposition;
COORD oldballposition;
DWORD dwWritten;
CHAR chBuffer[256];
//setup handle to STDout
HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
//size of screen
SMALL_RECT rc = { 0, 0, 40, 20 };
BOOL bRet = SetConsoleWindowInfo(hStdout, TRUE, &rc);
//size of buffer (removes scroll bars)
if(bRet)
{
COORD cd = {
41,
21
};
bRet = SetConsoleScreenBufferSize(hStdout, cd);
}
//setup ball
//whats ball look like
char Ball[]={"@"};
char OldBall[]={" "};
//inital direction
int dx =1;
int dy =1;
//initial position
oldballposition.X=9;
oldballposition.Y=9;
ballposition.X=10;
ballposition.Y=5;
//extenstion would be to detect key presses to allow quitting
while(1)
{
//move ball in direction
ballposition.X=ballposition.X+dx;
ballposition.Y=ballposition.Y+dy;
//sleep (contols speed
Sleep(20);
//erase the ball from screen
SetConsoleCursorPosition(hStdout, oldballposition);
WriteFile(hStdout, OldBall, sizeof(OldBall), &dwWritten, NULL);
//print ball to screen
SetConsoleCursorPosition(hStdout, ballposition);
WriteFile(hStdout, Ball, sizeof(Ball), &dwWritten, NULL);
//change ball direction if we hit wall
if (ballposition.X > 39)
{
dx = -dx;
}
if (ballposition.X < 1)
{
dx= -dx;
}
if (ballposition.Y >19)
{
dy = -dy;
}
if (ballposition.Y < 1)
{
dy = -dy;
}
//set position of where ball was
oldballposition = ballposition ;
}
//close and tidy (never reached lol)
CloseHandle(hStdout) ;
}
|
This is probably the longest c/c++ program i have ever written lol.
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Tue Dec 26, 2006 2:21 pm Post subject: |
|
|
|
|
|
|
Back to top |
|
|
|