Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Pipo DeClown

Input Output NewB AI

This topic is 5895 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can you create a frame to write you source code in?
Hi! I have a problem, i think this should be an AI-thing but i''m not quite suire. #include <iostream.h> #include <stdlib.h> #include <fstream.h> #include <string.h> #include <conio.h> #include <stdio.h> #include <windows.h> #include <string> using namespace std; void main() { HANDLE OutputH; HANDLE InputH; INPUT_RECORD i_r; COORD pos; DWORD event=FALSE; OutputH = GetStdHandle(STD_OUTPUT_HANDLE); InputH=GetStdHandle(STD_INPUT_HANDLE); SetConsoleMode(InputH, ENABLE_PROCESSED_INPUT); pos.X=0; pos.Y=0; while(TRUE) { SetConsoleCursorPosition(OutputH, pos); ReadConsoleInput(InputH, &i_r, 1, &event); if (pos.X<0 ||pos.Y<0) { pos.X=0; pos.Y=0; } if(pos.X>80||pos.Y>80) { pos.X=80; pos.Y=80; } if(i_r.Event.KeyEvent.wVirtualKeyCode == VK_RIGHT) { pos.X++; cout <<"||||||||||||||||||||"; } if (i_r.Event.KeyEvent.wVirtualKeyCode == VK_LEFT) { pos.X--; cout<<"||||||||||||||||||||"; } if(i_r.Event.KeyEvent.wVirtualKeyCode == VK_SPACE) { pos.X=30; pos.Y=0; cout<<"||||||||||||||||||||"; } FlushConsoleInputBuffer(InputH); } system("pause"); return 0; } Thank you for helping me! BTW: i''m a newb............... __________________________________________________________________________________________ Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So...
__________________________________________________________________________________________

Share this post


Link to post
Share on other sites
Advertisement
Sorry! forgot to say what the prob is:

the SPACE key:
When you press it it prints something in the right, but i exually want it to print something in the middle....


Thnx Again!

__________________________________________________________________________________________
Can someone be nice and help me on my way to be the next Hideo Kojima? Thought So...
__________________________________________________________________________________________

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
RTFM

Share this post


Link to post
Share on other sites
uhm.........sorry!
But its a IF right?
and plz just tell me the prob~

__________________________________________________________________________________________
Can someone be nice and help me on my way to be the next Hideo Kojima?
Thought So...
__________________________________________________________________________________________

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!