Commit ee5f1004 authored by Brandon Toledo's avatar Brandon Toledo

I starded the display

parent a7fd44a7
#include <string>
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
const int SizeH = 5;
const int SizeV = 5;
class Display {
public:
void showGame(vector<string> game);
void printBox(string value);
void showGame(vector<vector<int>> game);
private:
void top() { cout << C << H << H << H << H << H << H << C << endl;}
void middle() {cout << V << S << S << S << S << S << S << V << endl;}
char H = '-'; //horizontal
char V = '|'; //vertical
char C = '+'; //corner
char S = ' '; //space
void topOrB() {cout << '+' << '-' << '-' << '-' << '-' << '-' << '-';}
void middle() {cout << '|' << ' ' << ' ' << ' ' << ' ' << ' ' << ' ';}
void number(int value) {cout << '|' << ' ' << setw(4) << value << ' ';}
};
// DOESN'T WORK
void Display::showGame(std::vector<string> game) { // this would create the display array
for (int i = 0; i < 25; i++) {
printBox(game.at(i));
if (i%5 == i/5) {
cout << endl;
}
}
}
void Display::printBox(string value) { // this function creates a single box
int numSize = 4 - value.size();
void Display:: showGame(vector<vector<int>> game) {
top();
middle();
cout << V << S;
for (int i = 0; i < numSize; i++) {
cout << S;
}
cout << value << S << V << endl;
middle();
top();
for (int i = 0; i )
}
int main() {
vector<string> test(25);
for (int i = 0; i < 25; i++) {test.at(i) = "G";}
Display game;
game.showGame(test);
//vector<string> test(16);
//for (int i = 0; i < 16; i++) {test.at(i) = i;}
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment