| | |
drawing - stickman with array
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2004
Posts: 489
Reputation:
Solved Threads: 5
Hello,
as you well know I've got a hangman game produced, I now have the luxury of adding to the code since all my work is completed ...yay, well, I've decieded to take it a step further and draw out the hunged man! I have the drawing , its just putting it into an array... Anyone offer suggestions?
to prove I'm working heres a sample code:
just wondering if my way im working on is the best for now?
as you well know I've got a hangman game produced, I now have the luxury of adding to the code since all my work is completed ...yay, well, I've decieded to take it a step further and draw out the hunged man! I have the drawing , its just putting it into an array... Anyone offer suggestions?
to prove I'm working heres a sample code:
C++ Syntax (Toggle Plain Text)
#include <iostream> using namespace std; int main() { char array[10] ="_____"; char array2[10] = "||||"; for(int i =0; i < 3 ;i++) { cout << array[i]; } cout << endl; for ( i = 0; i < 3 ; i++) { cout << array2[i] <<endl; } return 0; }
just wondering if my way im working on is the best for now?
Have an array of chars and draw it!
eg:
draws a simple smiley face!
eg:
C++ Syntax (Toggle Plain Text)
char array[] = { "+", "+", "+", "+", "+", "+", "0", "+", "0", "+", "+", "+", "^", "+", "+", "+", "_", "+", "_", "+", "+", "+", "-", "+", "+" }; int s = sizeof(array) / sizeof(char); for(int i = 0; i < s; i++) cout << array[i]; cout << "\n";
draws a simple smiley face!
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
Have an array of chars and draw it!
eg:
draws a simple smiley face!
sorry for repost, was supposed to be an edit!
eg:
C++ Syntax (Toggle Plain Text)
char array[] = { "+", "+", "+", "+", "+", "+", "0", "+", "0", "+", "+", "+", "^", "+", "+", "+", "_", "+", "_", "+", "+", "+", "-", "+", "+" }; int s = sizeof(array) / sizeof(char); for(int i = 0; i < s; i++) cout << array[i]; cout << "\n";
draws a simple smiley face!
sorry for repost, was supposed to be an edit!
http://sales.carina-e.com
no www
no nonsense
coming soon to a pc near you! :cool:
no www
no nonsense
coming soon to a pc near you! :cool:
![]() |
Similar Threads
- Storing data into an Array (C)
- Is there an array[x][y][z] in C++ (i.e TRIPLE ARRAY)??? (C++)
- Building an array for dice program (C#)
- Array limit (C)
- string to integer array transformation (C)
- Array (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Calculations
- Next Thread: what is the error
| Thread Tools | Search this Thread |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





