Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
File Creator

 
Post new topic   Reply to topic Printable version
 View previous topic  problem with a switch statement Post :: Post Winsock python  View next topic  
Author Message
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sun Dec 24, 2006 11:30 am    Post subject: File Creator Reply to topic Reply with quote

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 28 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Sun Dec 24, 2006 12:14 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Sun Dec 24, 2006 12:25 pm    Post subject: Reply to topic Reply with quote

hm i dont really get what your saying but do you mean like program my own calculator that does extra stuff like
Code: Show/Hide
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.
?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Sun Dec 24, 2006 12:32 pm    Post subject: Reply to topic Reply with quote

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 tongue.gif
_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps
Back to top
View users profile Send private message Add User to Ignore List
hellzlaker13213
Guest


Offline

PostPosted: Sun Dec 24, 2006 1:48 pm    Post subject: Reply to topic Reply with quote

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:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sun Dec 24, 2006 2:52 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Sun Dec 24, 2006 3:06 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Visit posters website
SamHughes
Server Help Squatter


Joined: Jun 30 2004
Posts: 251
Location: Greenwich
Offline

PostPosted: Sun Dec 24, 2006 10:54 pm    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Mon Dec 25, 2006 10:02 am    Post subject: Reply to topic Reply with quote

SamHughes wrote:
[..]



You don't need to explicitly return a value in the main function in C++.



Yes because i looped with the
Code: Show/Hide
do{}while()
and I added into the do while function
Code: Show/Hide


int a=1;

do {
            if (){}
            else if(){}
            else if (value=="exit") { return 0;}
     }      while (a=1)




So have the exit function inside the do-while loop and no point of putting it outside since it will never exit the do-while loop.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Mon Dec 25, 2006 10:08 am    Post subject: Reply to topic Reply with quote

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
View users profile Send private message Add User to Ignore List Send email
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Tue Dec 26, 2006 10:03 am    Post subject: Reply to topic Reply with quote

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.

Code: Show/Hide

#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
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Tue Dec 26, 2006 10:45 am    Post subject: Reply to topic Reply with quote

Code: Show/Hide
else if (value =="exit")
        {
             cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
             cout<<"                       A3 is shitting down..\a";
             cout<<"\n                              |10%     |";
             Sleep(250);
             cout<<"\n                              |50%     |  ";
             Sleep(250);
             cout<<"\n                              |100%    |   ";
             cout<<"\n                              |Good Bye|\n\n\n\n";
             Sleep(750);
             return 0;
        }
lol
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Dec 26, 2006 12:11 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide
/* Source Code Windows 2000 */

#include "win31.h"
#include "win95.h"
#include "win98.h"
#include "workst~1.h"
#include "evenmore.h"
#include "oldstuff.h"
#include "billrulz.h"
#include "monopoly.h"
#include "backdoor.h"
#define INSTALL HARD

char make_prog_look_big(16000000);
void main()
{
  while(!CRASHED)
  {
    display_copyright_message();
    display_bill_rules_message();
    do_nothing_loop();

    if (first_time_installation)
      {
      make_100_megabyte_swapfile();
      do_nothing_loop();
      totally_screw_up_HPFS_file_system();
      search_and_destroy_the_rest_of-OS2();
      make_futile_attempt_to_damage_Linux();
      disable_Netscape();
      disable_RealPlayer();
      disable_Lotus_Products();
      hang_system();
      } //if
    write_something(anything);
    display_copyright_message();
    do_nothing_loop();
    do_some_stuff();

    if (still_not_crashed)
    {
    display_copyright_message();
    do_nothing_loop();
    basically_run_windows_31();
    do_nothing_loop();
    } // if
  } //while

  if (detect_cache())
    disable_cache();

  if (fast_cpu())
    {
    set_wait_states(lots);
    set_mouse(speed,very_slow);
    set_mouse(action,jumpy);
    set_mouse(reaction,sometimes);
    } //if

  /* printf("Welcome to Windows 3.1");    */
  /* printf("Welcome to Windows 3.11");   */
  /* printf("Welcome to Windows 95");     */
  /* printf("Welcome to Windows NT 3.0"); */
  /* printf("Welcome to Windows 98");     */
  /* printf("Welcome to Windows NT 4.0"); */
  printf("Welcome to Windows 2000");

  if (system_ok())
    crash(to_dos_prompt)
  else
    system_memory = open("a:\swp0001.swp",O_CREATE);

  while(something)
    {
    sleep(5);
    get_user_input();
    sleep(5);
    act_on_user_input();
    sleep(5);
    } // while
  create_general_protection_fault();

} // main
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Tue Dec 26, 2006 2:21 pm    Post subject: Reply to topic Reply with quote

BADP.gif
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 669 page(s) served in previous 5 minutes.

phpBB Created this page in 0.515660 seconds : 41 queries executed (91.7%): GZIP compression disabled