Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> draw_card(const Carta& carta){
- /*
- int16_t a0 = 0b 0000 0000 0000 0000;
- 0x 0 0 0 0
- int16_t a1 = 0b 0000 0100 0000 0000;
- 0x 0 4 0 0
- int16_t a2 = 0b 0000 1010 0000 0000;
- 0x 0 A 0 0
- int16_t a3 = 0b 0001 1111 0000 0000;
- 0x 1 F 0 0
- int16_t a4 = 0b 0010 0000 1000 0000;
- 0x 2 0 8 0
- int16_t a5 = 0b 0100 0000 0100 0000;
- 0x 4 0 4 0
- int16_t a6 = 0b 0000 0000 0000 0000;
- 0x 0 0 0 0
- */
- vector<uint16_t> middle_matrix;
- middle_matrix.push_back(0x0000); //0
- middle_matrix.push_back(0x0400); //1024
- middle_matrix.push_back(0x0A00); //2560
- middle_matrix.push_back(0x1F00); //7936
- middle_matrix.push_back(0x2080); //8320
- middle_matrix.push_back(0x4040); //16448
- middle_matrix.push_back(0x0000); //0
- // first line of the matrix is
- vector<string> v;
- v.push_back("|-----------|");
- string nome_seme = create_semi(carta.seme);
- string nome_valore = create_nome_valore(carta.valore);
- vector<string> carta_grafica;
- string init_string = "| |";
- for(unsigned int i = 0; i < init_string.size(); ++i){
- unsigned int valore_offset = 1;
- unsigned int seme_offset = nome_valore.size() + valore_offset + 1;
- if(i >= valore_offset && i < nome_valore.size() + valore_offset){
- init_string[i] = nome_valore[i-valore_offset];
- }
- if(i >= seme_offset && i <= nome_seme.size() + seme_offset - 1){
- init_string[i] = nome_seme[i-seme_offset];
- }
- }
- v.push_back(init_string);
- for(unsigned int i = 0; i < middle_matrix.size(); ++i){
- string line = "|";
- for(uint16_t mask = 0x8000; mask != 0x0010; mask >>= 1){
- cout << mask << " " << middle_matrix[i] << " ";
- if(middle_matrix[i] & mask){
- line += "*";
- }
- else{
- line += " ";
- }
- }
- line += "|";
- v.push_back(line);
- }
- //for (string x : v){cout << x << endl;}
- for(unsigned int i = 0; i < v.size(); ++i){
- cout << v[i] << endl;
- }
- return v;
- }
- /*OUTPUT
- |Asso picche|
- | |
- | * |
- | * * |
- | ***** |
- | * * |
- | * * |
- | |
- */
Add Comment
Please, Sign In to add comment