| | |
C++ Slot machine
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
I thinking of a number between 223 and 367 -- what is it?
[Translation -- do you think you could be a little more specific?]
[Translation -- do you think you could be a little more specific?]
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
Join Date: Nov 2005
Posts: 5
Reputation:
Solved Threads: 0
When the numbers are output to the screen, I have them come up about .25" apart from each other horizontally. When they are displayed, can they be made to look like they spinning, and then the one on the left stops 1st, then the one in the middle stops spinning, then then the one on the right stops spinning? Get it?
Are you doing some sort of graphics stuff, or does this relate to the standard C or C++ languages?
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
A start for windows. Modify to your requirements.Further Reference
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <windows.h> int main() { DWORD dwWritten; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo; GetConsoleScreenBufferInfo(hConsole, &ConsoleScreenBufferInfo); COORD coordCurrent = ConsoleScreenBufferInfo.dwCursorPosition; for ( int j = 0 ; j < 10 ; j++ ) { FillConsoleOutputCharacter(hConsole, j + toascii('0'), 1, coordCurrent, &dwWritten); coordCurrent.X++; FillConsoleOutputCharacter(hConsole, toascii('9') - j , 1, coordCurrent, &dwWritten); Sleep( 100 ); coordCurrent.X--; } coordCurrent.X += 2; SetConsoleCursorPosition( hConsole,coordCurrent ); std::cin.ignore(); return 0; }
Output the line of text. Then output a carriage return
'\r'. This may or may not let you start overwriting the same line. "One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { for ( ;; ) { cout << "\r 1 2 3"; cout << "\r 4 5 6"; cout << "\r 7 8 9"; } return 0; }
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
![]() |
Similar Threads
- Blue Screen Error (Windows NT / 2000 / XP)
- The Vending Machine Game (Posting Games)
- C++ Random Numbers (C++)
- G4 crashes once a day (Apple Hardware)
- jabil amd r4 motherboard, need help (Motherboards, CPUs and RAM)
- Computer does not detect modem and does not show in device manager (Windows NT / 2000 / XP)
- SLOT MACHINE PROGRAM... Help plsss! (C)
Other Threads in the C++ Forum
- Previous Thread: stuck with file streaming conditions
- Next Thread: creating our own C++ strcat() function, code reqd
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamic email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






