Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "answer.h"
- #include "ui_answer.h"
- #include "maingame.h"
- Answer::Answer(QWidget *parent) :
- QDialog(parent),
- mode(0),
- ui(new Ui::Answer)
- {
- ui->setupUi(this);
- this->setWindowTitle("Answer!");
- connect(ui->answerBox, SIGNAL(clicked(QAbstractButton*)), ui->answerLabel, SLOT(clear()));
- }
- Answer::~Answer()
- {
- delete ui;
- }
- void Answer::setMode(int index) {
- this->mode = index;
- }
- void Answer::setAnswer() {
- QString pos;
- QString neg;
- if(this->mode == 0) {
- //Hydracids
- if(mainGame::getNegHydraV() == "F<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrofluoric acid";
- } else if(mainGame::getNegHydraV() == "F<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen fluoride";
- } else if(mainGame::getNegHydraV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrochloric acid";
- } else if(mainGame::getNegHydraV() == "Cl<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen chloride";
- } else if(mainGame::getNegHydraV() == "Br<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrobromic acid";
- } else if(mainGame::getNegHydraV() == "Br<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen bromide";
- } else if(mainGame::getNegHydraV() == "I<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydroiodic acid";
- } else if(mainGame::getNegHydraV() == "I<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen iodide";
- } else if(mainGame::getNegHydraV() == "CN<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrocyanic acid";
- } else if(mainGame::getNegHydraV() == "CN<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen cyanide";
- } else if(mainGame::getNegHydraV() == "S<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrosulfuric acid";
- } else if(mainGame::getNegHydraV() == "S<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen sulfide";
- }
- ui->answerLabel->setText(neg);
- } else if(this->mode == 1) {
- if(mainGame::getPosSaltV() == "Ca<sup>2+</sup>") {
- pos = "calcium";
- } else if(mainGame::getPosSaltV() == "Na<sup>+</sup>") {
- pos = "sodium";
- } else if(mainGame::getPosSaltV() == "Cs<sup>+</sup>" ) {
- pos = "cesium";
- } else if(mainGame::getPosSaltV() == "Li<sup>+</sup>") {
- pos = "lithium";
- } else if(mainGame::getPosSaltV() == "K<sup>+</sup>") {
- pos = "potassium";
- } else if(mainGame::getPosSaltV() == "Rb<sup>+</sup>") {
- pos = "rubidium";
- } else if(mainGame::getPosSaltV() == "Fr<sup>+</sup>") {
- pos = "francium";
- } else if(mainGame::getPosSaltV() == "Be<sup>2+</sup>") {
- pos = "beryllium";
- } else if(mainGame::getPosSaltV() == "Mg<sup>2+</sup>") {
- pos = "magnesium";
- } else if(mainGame::getPosSaltV() == "Sr<sup>2+</sup>") {
- pos = "strontium";
- } else if(mainGame::getPosSaltV() == "Ba<sup>2+</sup>") {
- pos = "barium";
- } else if(mainGame::getPosSaltV() == "Ra<sup>2+</sup>") {
- pos = "radium";
- } else if(mainGame::getPosSaltV() == "Al<sup>3+</sup>") {
- pos = "aluminum";
- } else if(mainGame::getPosSaltV() == "Ga<sup>3+</sup>") {
- pos = "gallium";
- } else if(mainGame::getPosSaltV() == "Ge<sup>3+</sup>") {
- pos = "germanium";
- } else if(mainGame::getPosSaltV() == "H<sup>+</sup>") {
- pos = "hydrogen";
- }
- if(mainGame::getNegSaltV() == "C<sup>4-</sup>") {
- neg = "carbide";
- } else if(mainGame::getNegSaltV() == "N<sup>3-</sup>") {
- neg = "nitride";
- } else if(mainGame::getNegSaltV() == "O<sup>2-</sup>") {
- neg = "oxide";
- } else if(mainGame::getNegSaltV() == "P<sup>3-</sup>") {
- neg = "phosphide";
- } else if(mainGame::getNegSaltV() == "S<sup>2-</sup>") {
- neg = "sulfide";
- } else if(mainGame::getNegSaltV() == "Se<sup>2-</sup>") {
- neg = "selenide";
- } else if(mainGame::getNegSaltV() == "F<sup>-</sup>") {
- neg = "fluoride";
- } else if(mainGame::getNegSaltV() == "Cl<sup>-</sup>") {
- neg = "chloride";
- } else if(mainGame::getNegSaltV() == "Br<sup>-</sup>") {
- neg = "bromide";
- } else if(mainGame::getNegSaltV() == "I<sup>-</sup>") {
- neg = "iodide";
- } else if(mainGame::getNegSaltV() == "CN<sup>-</sup>") {
- neg = "cyanide";
- }
- ui->answerLabel->setText(pos + " " + neg);
- } else if(this->mode == 2) {
- //Hydracids/Salts
- if(!(mainGame::getPosHydraSaltV() == "H<sup>+</sup>")) {
- if(mainGame::getPosHydraSaltV() == "Ca<sup>2+</sup>") {
- pos = "calcium";
- } else if(mainGame::getPosHydraSaltV() == "Na<sup>+</sup>") {
- pos = "sodium";
- } else if(mainGame::getPosHydraSaltV() == "Cs<sup>+</sup>" ) {
- pos = "cesium";
- } else if(mainGame::getPosHydraSaltV() == "Li<sup>+</sup>") {
- pos = "lithium";
- } else if(mainGame::getPosHydraSaltV() == "K<sup>+</sup>") {
- pos = "potassium";
- } else if(mainGame::getPosHydraSaltV() == "Rb<sup>+</sup>") {
- pos = "rubidium";
- } else if(mainGame::getPosHydraSaltV() == "Fr<sup>+</sup>") {
- pos = "francium";
- } else if(mainGame::getPosHydraSaltV() == "Be<sup>2+</sup>") {
- pos = "beryllium";
- } else if(mainGame::getPosHydraSaltV() == "Mg<sup>2+</sup>") {
- pos = "magnesium";
- } else if(mainGame::getPosHydraSaltV() == "Sr<sup>2+</sup>") {
- pos = "strontium";
- } else if(mainGame::getPosHydraSaltV() == "Ba<sup>2+</sup>") {
- pos = "barium";
- } else if(mainGame::getPosHydraSaltV() == "Ra<sup>2+</sup>") {
- pos = "radium";
- } else if(mainGame::getPosHydraSaltV() == "Al<sup>3+</sup>") {
- pos = "aluminum";
- } else if(mainGame::getPosHydraSaltV() == "Ga<sup>3+</sup>") {
- pos = "gallium";
- } else if(mainGame::getPosHydraSaltV() == "Ge<sup>3+</sup>") {
- pos = "germanium";
- }
- if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(aq)</sub>") {
- neg = "fluoride";
- } else if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(g)</sub>") {
- neg = "fluoride";
- } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
- neg = "chloride";
- } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(g)</sub>") {
- neg = "chloride";
- } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(aq)</sub>") {
- neg = "bromide";
- } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(g)</sub>") {
- neg = "bromide";
- } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(aq)</sub>") {
- neg = "iodide";
- } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(g)</sub>") {
- neg = "iodide";
- } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(aq)</sub>") {
- neg = "cyanide";
- } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(g)</sub>") {
- neg = "cyanide";
- } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(aq)</sub>") {
- neg = "sulfide";
- } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(g)</sub>") {
- neg = "sulfide";
- }
- ui->answerLabel->setText(pos + " " + neg);
- } else {
- if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrofluoric acid";
- } else if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen fluoride";
- } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrochloric acid";
- } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen chloride";
- } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrobromic acid";
- } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen bromide";
- } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydroiodic acid";
- } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen iodide";
- } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrocyanic acid";
- } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen cyanide";
- } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(aq)</sub>") {
- neg = "hydrosulfuric acid";
- } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(g)</sub>") {
- neg = "hydrogen sulfide";
- }
- ui->answerLabel->setText(neg);
- }
- } else if(this->mode == 3) {
- if(mainGame::getNegOxoV() == "CO<sub>3</sub><sup>2-</sup>") {
- neg = "carbonic acid";
- } else if(mainGame::getNegOxoV() == "NO<sub>2</sub><sup>-</sup>") {
- neg = "nitrous acid";
- } else if(mainGame::getNegOxoV() == "NO<sub>3</sub><sup>-</sup>") {
- neg = "nitric acid";
- } else if(mainGame::getNegOxoV() == "PO<sub>4</sub><sup>3-</sup>") {
- neg = "phosphoric acid";
- } else if(mainGame::getNegOxoV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
- neg = "acetic acid";
- } else if(mainGame::getNegOxoV() == "BrO<sub>2</sub><sup>-</sup>") {
- neg = "bromous acid";
- } else if(mainGame::getNegOxoV() == "SO<sub>3</sub><sup>2-</sup>") {
- neg = "sulfurous acid";
- } else if(mainGame::getNegOxoV() == "SO<sub>4</sub><sup>2-</sup>") {
- neg = "sulfuric acid";
- } else if(mainGame::getNegOxoV() == "PO<sub>3</sub><sup>3-</sup>") {
- neg = "phosphorous acid";
- } else if(mainGame::getNegOxoV() == "ClO<sup>-</sup>") {
- neg = "hypochlorous acid";
- } else if(mainGame::getNegOxoV() == "ClO<sub>2</sub><sup>-</sup>") {
- neg = "chlorous acid";
- } else if(mainGame::getNegOxoV() == "ClO<sub>3</sub><sup>-</sup>") {
- neg = "chloric acid";
- } else if(mainGame::getNegOxoV() == "ClO<sub>4</sub><sup>-</sup>") {
- neg = "perchloric acid";
- } else if(mainGame::getNegOxoV() == "BrO<sup>-</sup>") {
- neg = "hypobromous acid";
- } else if(mainGame::getNegOxoV() == "BrO<sub>3</sub><sup>-</sup>") {
- neg = "bromic acid";
- } else if(mainGame::getNegOxoV() == "BrO<sub>4</sub><sup>-</sup>") {
- neg = "perbromic acid";
- } else if(mainGame::getNegOxoV() == "IO<sup>-</sup>") {
- neg = "hypoiodous";
- } else if(mainGame::getNegOxoV() == "IO<sub>2</sub><sup>-</sup>") {
- neg = "iodous acid";
- } else if(mainGame::getNegOxoV() == "IO<sub>3</sub><sup>-</sup>") {
- neg = "iodic acid";
- } else if(mainGame::getNegOxoV() == "IO<sub>4</sub><sup>-</sup>") {
- neg = "periodic acid";
- } else if(mainGame::getNegOxoV() == "BO<sub>3</sub><sup>3-</sup>") {
- neg = "boric acid";
- } else if(mainGame::getNegOxoV() == "CrO<sub>4</sub><sup>2-</sup>") {
- neg = "chromic acid";
- }
- ui->answerLabel->setText(neg);
- } else if(this->mode == 4) {
- //Oxoacids/Salts
- if(!(mainGame::getPosOxoSaltV() == "H<sup>+</sup>")) {
- /*START POSITIVES*/
- if(mainGame::getPosOxoSaltV() == "Ca<sup>2+</sup>") {
- pos = "calcium";
- } else if(mainGame::getPosOxoSaltV() == "Na<sup>+</sup>") {
- pos = "sodium";
- } else if(mainGame::getPosOxoSaltV() == "Cs<sup>+</sup>" ) {
- pos = "cesium";
- } else if(mainGame::getPosOxoSaltV() == "Pb<sup>4+</sup>") {
- pos = "lead (IV)";
- } else if(mainGame::getPosOxoSaltV() == "Pb<sup>2+</sup>") {
- pos = "lead (II)";
- } else if(mainGame::getPosOxoSaltV() == "Li<sup>+</sup>") {
- pos = "lithium";
- } else if(mainGame::getPosOxoSaltV() == "K<sup>+</sup>") {
- pos = "potassium";
- } else if(mainGame::getPosOxoSaltV() == "Rb<sup>+</sup>") {
- pos = "rubidium";
- } else if(mainGame::getPosOxoSaltV() == "Fr<sup>+</sup>") {
- pos = "francium";
- } else if(mainGame::getPosOxoSaltV() == "Be<sup>2+</sup>") {
- pos = "beryllium";
- } else if(mainGame::getPosOxoSaltV() == "Mg<sup>2+</sup>") {
- pos = "magnesium";
- } else if(mainGame::getPosOxoSaltV() == "Sr<sup>2+</sup>") {
- pos = "strontium";
- } else if(mainGame::getPosOxoSaltV() == "Ba<sup>2+</sup>") {
- pos = "barium";
- } else if(mainGame::getPosOxoSaltV() == "Ra<sup>2+</sup>") {
- pos = "radium";
- } else if(mainGame::getPosOxoSaltV() == "Cr<sup>2+</sup>") {
- pos = "chromium (II)";
- } else if(mainGame::getPosOxoSaltV() == "Cr<sup>3+</sup>") {
- pos = "chromium (III)";
- } else if(mainGame::getPosOxoSaltV() == "Fe<sup>2+</sup>") {
- pos = "iron (II)";
- } else if(mainGame::getPosOxoSaltV() == "Fe<sup>3+</sup>") {
- pos = "iron (III)";
- } else if(mainGame::getPosOxoSaltV() == "Co<sup>2+</sup>") {
- pos = "cobalt (II)";
- } else if(mainGame::getPosOxoSaltV() == "Co<sup>3+</sup>") {
- pos = "cobalt (III)";
- } else if(mainGame::getPosOxoSaltV() == "Cu<sup>+</sup>") {
- pos = "copper (I)";
- } else if(mainGame::getPosOxoSaltV() == "Cu<sup>2+</sup>") {
- pos = "copper (II)";
- } else if(mainGame::getPosOxoSaltV() == "Ag<sup>+</sup>") {
- pos = "silver";
- } else if(mainGame::getPosOxoSaltV() == "Hg<sup>2+</sup>") {
- pos = "mercury (II)";
- } else if(mainGame::getPosOxoSaltV() == "Al<sup>3+</sup>") {
- pos = "aluminum";
- } else if(mainGame::getPosOxoSaltV() == "Ga<sup>3+</sup>") {
- pos = "gallium";
- } else if(mainGame::getPosOxoSaltV() == "Ge<sup>3+</sup>") {
- pos = "germanium";
- } else if(mainGame::getPosOxoSaltV() == "Sn<sup>2+</sup>") {
- pos = "tin (II)";
- } else if(mainGame::getPosOxoSaltV() == "Sn<sup>4+</sup>") {
- pos = "tin (IV)";
- } else if(mainGame::getPosOxoSaltV() == "Zn<sup>2+</sup>") {
- pos = "zinc";
- }
- /*END POSITIVES*/
- /*START NEGATIVES*/
- if(mainGame::getNegOxoSaltV() == "CO<sub>3</sub><sup>2-</sup>") {
- neg = "carbonate";
- } else if(mainGame::getNegOxoSaltV() == "NO<sub>2</sub><sup>-</sup>") {
- neg = "nitrite";
- } else if(mainGame::getNegOxoSaltV() == "NO<sub>3</sub><sup>-</sup>") {
- neg = "nitrate";
- } else if(mainGame::getNegOxoSaltV() == "PO<sub>4</sub><sup>3-</sup>") {
- neg = "phosphate";
- } else if(mainGame::getNegOxoSaltV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
- neg = "acetate";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>2</sub><sup>-</sup>") {
- neg = "bromite";
- } else if(mainGame::getNegOxoSaltV() == "SO<sub>3</sub><sup>2-</sup>") {
- neg = "sulfite";
- } else if(mainGame::getNegOxoSaltV() == "SO<sub>4</sub><sup>2-</sup>") {
- neg = "sulfate";
- } else if(mainGame::getNegOxoSaltV() == "PO<sub>3</sub><sup>3-</sup>") {
- neg = "phosphite";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sup>-</sup>") {
- neg = "hypochlorite";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>2</sub><sup>-</sup>") {
- neg = "chlorite";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>3</sub><sup>-</sup>") {
- neg = "chlorate";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>4</sub><sup>-</sup>") {
- neg = "perchlorate";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sup>-</sup>") {
- neg = "hypobromite";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>3</sub><sup>-</sup>") {
- neg = "bromate";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>4</sub><sup>-</sup>") {
- neg = "perbromate";
- } else if(mainGame::getNegOxoSaltV() == "IO<sup>-</sup>") {
- neg = "hypoiodite";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>2</sub><sup>-</sup>") {
- neg = "iodite";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>3</sub><sup>-</sup>") {
- neg = "iodate";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>4</sub><sup>-</sup>") {
- neg = "periodate";
- } else if(mainGame::getNegOxoSaltV() == "BO<sub>3</sub><sup>3-</sup>") {
- neg = "borate";
- } else if(mainGame::getNegOxoSaltV() == "CrO<sub>4</sub><sup>2-</sup>") {
- neg = "chromate";
- }
- /*END NEGATIVES*/
- ui->answerLabel->setText(pos + " " + neg);
- } else if(mainGame::getPosOxoSaltV() == "H<sup>+</sup>") {
- if(mainGame::getNegOxoSaltV() == "CO<sub>3</sub><sup>2-</sup>") {
- neg = "carbonic acid";
- } else if(mainGame::getNegOxoSaltV() == "NO<sub>2</sub><sup>-</sup>") {
- neg = "nitrous acid";
- } else if(mainGame::getNegOxoSaltV() == "NO<sub>3</sub><sup>-</sup>") {
- neg = "nitric acid";
- } else if(mainGame::getNegOxoSaltV() == "PO<sub>4</sub><sup>3-</sup>") {
- neg = "phosphoric acid";
- } else if(mainGame::getNegOxoSaltV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
- neg = "acetic acid";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>2</sub><sup>-</sup>") {
- neg = "bromous acid";
- } else if(mainGame::getNegOxoSaltV() == "SO<sub>3</sub><sup>2-</sup>") {
- neg = "sulfurous acid";
- } else if(mainGame::getNegOxoSaltV() == "SO<sub>4</sub><sup>2-</sup>") {
- neg = "sulfuric acid";
- } else if(mainGame::getNegOxoSaltV() == "PO<sub>3</sub><sup>3-</sup>") {
- neg = "phosphorous acid";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sup>-</sup>") {
- neg = "hypochlorous acid";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>2</sub><sup>-</sup>") {
- neg = "chlorous acid";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>3</sub><sup>-</sup>") {
- neg = "chloric acid";
- } else if(mainGame::getNegOxoSaltV() == "ClO<sub>4</sub><sup>-</sup>") {
- neg = "perchloric acid";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sup>-</sup>") {
- neg = "hypobromous acid";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>3</sub><sup>-</sup>") {
- neg = "bromic acid";
- } else if(mainGame::getNegOxoSaltV() == "BrO<sub>4</sub><sup>-</sup>") {
- neg = "perbromic acid";
- } else if(mainGame::getNegOxoSaltV() == "IO<sup>-</sup>") {
- neg = "hypoiodous";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>2</sub><sup>-</sup>") {
- neg = "iodous acid";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>3</sub><sup>-</sup>") {
- neg = "iodic acid";
- } else if(mainGame::getNegOxoSaltV() == "IO<sub>4</sub><sup>-</sup>") {
- neg = "periodic acid";
- } else if(mainGame::getNegOxoSaltV() == "BO<sub>3</sub><sup>3-</sup>") {
- neg = "boric acid";
- } else if(mainGame::getNegOxoSaltV() == "CrO<sub>4</sub><sup>2-</sup>") {
- neg = "chromic acid";
- }
- ui->answerLabel->setText(neg);
- }
- } else if(this->mode == 5) {
- if(mainGame::getPosMotV() == "Pb<sup>4+</sup>") {
- pos = "lead (IV)";
- } else if(mainGame::getPosMotV() == "Pb<sup>2+</sup>") {
- pos = "lead (II)";
- } else if(mainGame::getPosMotV() == "Cr<sup>2+</sup>") {
- pos = "chromium (II)";
- } else if(mainGame::getPosMotV() == "Cr<sup>3+</sup>") {
- pos = "chromium (III)";
- } else if(mainGame::getPosMotV() == "Fe<sup>2+</sup>") {
- pos = "iron (II)";
- } else if(mainGame::getPosMotV() == "Fe<sup>3+</sup>") {
- pos = "iron (III)";
- } else if(mainGame::getPosMotV() == "Co<sup>2+</sup>") {
- pos = "cobalt (II)";
- } else if(mainGame::getPosMotV() == "Co<sup>3+</sup>") {
- pos = "cobalt (III)";
- } else if(mainGame::getPosMotV() == "Cu<sup>+</sup>") {
- pos = "copper (I)";
- } else if(mainGame::getPosMotV() == "Cu<sup>2+</sup>") {
- pos = "copper (II)";
- } else if(mainGame::getPosMotV() == "Ag<sup>+</sup>") {
- pos = "silver";
- } else if(mainGame::getPosMotV() == "Hg<sup>2+</sup>") {
- pos = "mercury (II)";
- } else if(mainGame::getPosMotV() == "Sn<sup>2+</sup>") {
- pos = "tin (II)";
- } else if(mainGame::getPosMotV() == "Sn<sup>4+</sup>") {
- pos = "tin (IV)";
- } else if(mainGame::getPosMotV() == "Zn<sup>2+</sup>") {
- pos = "zinc";
- }
- if(mainGame::getNegMotV() == "C<sup>4-</sup>") {
- neg = "carbide";
- } else if(mainGame::getNegMotV() == "N<sup>3-</sup>") {
- neg = "nitride";
- } else if(mainGame::getNegMotV() == "O<sup>2-</sup>") {
- neg = "oxide";
- } else if(mainGame::getNegMotV() == "P<sup>3-</sup>") {
- neg = "phosphide";
- } else if(mainGame::getNegMotV() == "S<sup>2-</sup>") {
- neg = "sulfide";
- } else if(mainGame::getNegMotV() == "Se<sup>2-</sup>") {
- neg = "selenide";
- } else if(mainGame::getNegMotV() == "F<sup>-</sup>") {
- neg = "fluoride";
- } else if(mainGame::getNegMotV() == "Cl<sup>-</sup>") {
- neg = "chloride";
- } else if(mainGame::getNegMotV() == "Br<sup>-</sup>") {
- neg = "bromide";
- } else if(mainGame::getNegMotV() == "I<sup>-</sup>") {
- neg = "iodide";
- } else if(mainGame::getNegMotV() == "CN<sup>-</sup>") {
- neg = "cyanide";
- } else if(mainGame::getNegMotV() == "CO<sub>3</sub><sup>2-</sup>") {
- neg = "carbonate";
- } else if(mainGame::getNegMotV() == "NO<sub>2</sub><sup>-</sup>") {
- neg = "nitrite";
- } else if(mainGame::getNegMotV() == "NO<sub>3</sub><sup>-</sup>") {
- neg = "nitrate";
- } else if(mainGame::getNegMotV() == "PO<sub>4</sub><sup>3-</sup>") {
- neg = "phosphate";
- } else if(mainGame::getNegMotV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
- neg = "acetate";
- } else if(mainGame::getNegMotV() == "BrO<sub>2</sub><sup>-</sup>") {
- neg = "bromite";
- } else if(mainGame::getNegMotV() == "SO<sub>3</sub><sup>2-</sup>") {
- neg = "sulfite";
- } else if(mainGame::getNegMotV() == "SO<sub>4</sub><sup>2-</sup>") {
- neg = "sulfate";
- } else if(mainGame::getNegMotV() == "PO<sub>3</sub><sup>3-</sup>") {
- neg = "phosphite";
- } else if(mainGame::getNegMotV() == "ClO<sup>-</sup>") {
- neg = "hypochlorite";
- } else if(mainGame::getNegMotV() == "ClO<sub>2</sub><sup>-</sup>") {
- neg = "chlorite";
- } else if(mainGame::getNegMotV() == "ClO<sub>3</sub><sup>-</sup>") {
- neg = "chlorate";
- } else if(mainGame::getNegMotV() == "ClO<sub>4</sub><sup>-</sup>") {
- neg = "perchlorate";
- } else if(mainGame::getNegMotV() == "BrO<sup>-</sup>") {
- neg = "hypobromite";
- } else if(mainGame::getNegMotV() == "BrO<sub>3</sub><sup>-</sup>") {
- neg = "bromate";
- } else if(mainGame::getNegMotV() == "BrO<sub>4</sub><sup>-</sup>") {
- neg = "perbromate";
- } else if(mainGame::getNegMotV() == "IO<sup>-</sup>") {
- neg = "hypoiodite";
- } else if(mainGame::getNegMotV() == "IO<sub>2</sub><sup>-</sup>") {
- neg = "iodite";
- } else if(mainGame::getNegMotV() == "IO<sub>3</sub><sup>-</sup>") {
- neg = "iodate";
- } else if(mainGame::getNegMotV() == "IO<sub>4</sub><sup>-</sup>") {
- neg = "periodate";
- } else if(mainGame::getNegMotV() == "BO<sub>3</sub><sup>3-</sup>") {
- neg = "borate";
- } else if(mainGame::getNegMotV() == "CrO<sub>4</sub><sup>2-</sup>") {
- neg = "chromate";
- }
- ui->answerLabel->setText(pos + " " + neg);
- } else if(this->mode == 6) {
- if(mainGame::getPosOxHyV() == "Ca<sup>2+</sup>") {
- pos = "calcium";
- } else if(mainGame::getPosOxHyV() == "Na<sup>+</sup>") {
- pos = "sodium";
- } else if(mainGame::getPosOxHyV() == "Cs<sup>+</sup>" ) {
- pos = "cesium";
- } else if(mainGame::getPosOxHyV() == "Pb<sup>4+</sup>") {
- pos = "lead (IV)";
- } else if(mainGame::getPosOxHyV() == "Pb<sup>2+</sup>") {
- pos = "lead (II)";
- } else if(mainGame::getPosOxHyV() == "Li<sup>+</sup>") {
- pos = "lithium";
- } else if(mainGame::getPosOxHyV() == "K<sup>+</sup>") {
- pos = "potassium";
- } else if(mainGame::getPosOxHyV() == "Rb<sup>+</sup>") {
- pos = "rubidium";
- } else if(mainGame::getPosOxHyV() == "Fr<sup>+</sup>") {
- pos = "francium";
- } else if(mainGame::getPosOxHyV() == "Be<sup>2+</sup>") {
- pos = "beryllium";
- } else if(mainGame::getPosOxHyV() == "Mg<sup>2+</sup>") {
- pos = "magnesium";
- } else if(mainGame::getPosOxHyV() == "Sr<sup>2+</sup>") {
- pos = "strontium";
- } else if(mainGame::getPosOxHyV() == "Ba<sup>2+</sup>") {
- pos = "barium";
- } else if(mainGame::getPosOxHyV() == "Ra<sup>2+</sup>") {
- pos = "radium";
- } else if(mainGame::getPosOxHyV() == "Cr<sup>2+</sup>") {
- pos = "chromium (II)";
- } else if(mainGame::getPosOxHyV() == "Cr<sup>3+</sup>") {
- pos = "chromium (III)";
- } else if(mainGame::getPosOxHyV() == "Fe<sup>2+</sup>") {
- pos = "iron (II)";
- } else if(mainGame::getPosOxHyV() == "Fe<sup>3+</sup>") {
- pos = "iron (III)";
- } else if(mainGame::getPosOxHyV() == "Co<sup>2+</sup>") {
- pos = "cobalt (II)";
- } else if(mainGame::getPosOxHyV() == "Co<sup>3+</sup>") {
- pos = "cobalt (III)";
- } else if(mainGame::getPosOxHyV() == "Cu<sup>+</sup>") {
- pos = "copper (I)";
- } else if(mainGame::getPosOxHyV() == "Cu<sup>2+</sup>") {
- pos = "copper (II)";
- } else if(mainGame::getPosOxHyV() == "Ag<sup>+</sup>") {
- pos = "silver";
- } else if(mainGame::getPosOxHyV() == "Hg<sup>2+</sup>") {
- pos = "mercury (II)";
- } else if(mainGame::getPosOxHyV() == "Al<sup>3+</sup>") {
- pos = "aluminum";
- } else if(mainGame::getPosOxHyV() == "Ga<sup>3+</sup>") {
- pos = "gallium";
- } else if(mainGame::getPosOxHyV() == "Ge<sup>3+</sup>") {
- pos = "germanium";
- } else if(mainGame::getPosOxHyV() == "Sn<sup>2+</sup>") {
- pos = "tin (II)";
- } else if(mainGame::getPosOxHyV() == "Sn<sup>4+</sup>") {
- pos = "tin (IV)";
- } else if(mainGame::getPosOxHyV() == "Zn<sup>2+</sup>") {
- pos = "zinc";
- }
- if(mainGame::getNegOxHyV() == "H<sup>-</sup>") {
- neg = "hydride";
- } else if(mainGame::getNegOxHyV() == "O<sup>2-</sup>") {
- neg = "oxide";
- } else if(mainGame::getNegOxHyV() == "O<sub>2</sub><sup>2-</sup>") {
- neg = "peroxide";
- }
- ui->answerLabel->setText(pos + " " + neg);
- } else if(this->mode == 7) {
- if(mainGame::getPosComV() == "Ca<sup>2+</sup>") {
- pos = "calcium";
- } else if(mainGame::getPosComV() == "Na<sup>+</sup>") {
- pos = "sodium";
- } else if(mainGame::getPosComV() == "Cs<sup>+</sup>" ) {
- pos = "cesium";
- } else if(mainGame::getPosComV() == "Pb<sup>4+</sup>") {
- pos = "lead (IV)";
- } else if(mainGame::getPosComV() == "Pb<sup>2+</sup>") {
- pos = "lead (II)";
- } else if(mainGame::getPosComV() == "Li<sup>+</sup>") {
- pos = "lithium";
- } else if(mainGame::getPosComV() == "K<sup>+</sup>") {
- pos = "potassium";
- } else if(mainGame::getPosComV() == "Rb<sup>+</sup>") {
- pos = "rubidium";
- } else if(mainGame::getPosComV() == "Fr<sup>+</sup>") {
- pos = "francium";
- } else if(mainGame::getPosComV() == "Be<sup>2+</sup>") {
- pos = "beryllium";
- } else if(mainGame::getPosComV() == "Mg<sup>2+</sup>") {
- pos = "magnesium";
- } else if(mainGame::getPosComV() == "Sr<sup>2+</sup>") {
- pos = "strontium";
- } else if(mainGame::getPosComV() == "Ba<sup>2+</sup>") {
- pos = "barium";
- } else if(mainGame::getPosComV() == "Ra<sup>2+</sup>") {
- pos = "radium";
- } else if(mainGame::getPosComV() == "Cr<sup>2+</sup>") {
- pos = "chromium (II)";
- } else if(mainGame::getPosComV() == "Cr<sup>3+</sup>") {
- pos = "chromium (III)";
- } else if(mainGame::getPosComV() == "Fe<sup>2+</sup>") {
- pos = "iron (II)";
- } else if(mainGame::getPosComV() == "Fe<sup>3+</sup>") {
- pos = "iron (III)";
- } else if(mainGame::getPosComV() == "Co<sup>2+</sup>") {
- pos = "cobalt (II)";
- } else if(mainGame::getPosComV() == "Co<sup>3+</sup>") {
- pos = "cobalt (III)";
- } else if(mainGame::getPosComV() == "Cu<sup>+</sup>") {
- pos = "copper (I)";
- } else if(mainGame::getPosComV() == "Cu<sup>2+</sup>") {
- pos = "copper (II)";
- } else if(mainGame::getPosComV() == "Ag<sup>+</sup>") {
- pos = "silver";
- } else if(mainGame::getPosComV() == "Hg<sup>2+</sup>") {
- pos = "mercury (II)";
- } else if(mainGame::getPosComV() == "Al<sup>3+</sup>") {
- pos = "aluminum";
- } else if(mainGame::getPosComV() == "Ga<sup>3+</sup>") {
- pos = "gallium";
- } else if(mainGame::getPosComV() == "Ge<sup>3+</sup>") {
- pos = "germanium";
- } else if(mainGame::getPosComV() == "Sn<sup>2+</sup>") {
- pos = "tin (II)";
- } else if(mainGame::getPosComV() == "Sn<sup>4+</sup>") {
- pos = "tin (IV)";
- } else if(mainGame::getPosComV() == "Zn<sup>2+</sup>") {
- pos = "zinc";
- } else if(mainGame::getPosComV() == "H<sup>+</sup>") {
- pos = "hydrogen";
- }
- if(mainGame::getPosComV() == "") {
- if(mainGame::getNegComV() == "HCO<sub>3</sub><sup>-</sup>") {
- neg = "bicarbonate";
- } else if(mainGame::getNegComV() == "HPO<sub>4</sub><sup>2-</sup>") {
- neg = "monohydrogen phospate";
- } else if(mainGame::getNegComV() == "HSO<sub>3</sub><sup>-</sup>") {
- neg = "hydrogen sulfite";
- } else if(mainGame::getNegComV() == "HSO<sub>4</sub><sup>-</sup>") {
- neg = "hydrogen sulfate";
- } else if(mainGame::getNegComV() == "HPO<sub>3</sub><sup>2-</sup>") {
- neg = "monohydrogen phosphite";
- } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>3</sub><sup>-</sup>") {
- neg = "dihydrogen phosphite";
- } else if(mainGame::getNegComV() == "HC<sub>2</sub>O<sub>4</sub><sup>-</sup>") {
- neg = "binoxalate";
- } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>4</sub><sup>-</sup>") {
- neg = "dihydrogen phosphate";
- }
- } else {
- if(mainGame::getNegComV() == "HCO<sub>3</sub><sup>-</sup>") {
- neg = "bicarbonate";
- } else if(mainGame::getNegComV() == "HPO<sub>4</sub><sup>2-</sup>") {
- neg = "monohydrogen phospate";
- } else if(mainGame::getNegComV() == "HSO<sub>3</sub><sup>-</sup>") {
- neg = "hydrogen sulfite";
- } else if(mainGame::getNegComV() == "HSO<sub>4</sub><sup>-</sup>") {
- neg = "hydrogen sulfate";
- } else if(mainGame::getNegComV() == "HPO<sub>3</sub><sup>2-</sup>") {
- neg = "monohydrogen phosphite";
- } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>3</sub><sup>-</sup>") {
- neg = "dihydrogen phosphite";
- } else if(mainGame::getNegComV() == "HC<sub>2</sub>O<sub>4</sub><sup>-</sup>") {
- neg = "binoxalate";
- } else if(mainGame::getNegComV() == "C<sub>2</sub>O<sub>4</sub><sup>2-</sup>") {
- neg = "oxalate";
- } else if(mainGame::getNegComV() == "P<sub>2</sub>O<sub>7</sub><sup>4-</sup>") {
- neg = "pyrophosphate";
- } else if(mainGame::getNegComV() == "MnO<sub>4</sub><sup>2-</sup>") {
- neg = "manganate";
- } else if(mainGame::getNegComV() == "MnO<sub>4</sub><sup>-</sup>") {
- neg = "permanganate";
- } else if(mainGame::getNegComV() == "S<sub>2</sub>O<sub>3</sub><sup>2-</sup>") {
- neg = "thiosulfate";
- } else if(mainGame::getNegComV() == "Cr<sub>2</sub>O<sub>7</sub><sup>2-</sup>") {
- neg = "dichromate";
- } else if(mainGame::getNegComV() == "Fe(CN)<sub>6</sub><sup>3-</sup>") {
- neg = "ferricyanide";
- } else if(mainGame::getNegComV() == "Fe(CN)<sub>6</sub><sup>4-</sup>") {
- neg = "ferrocyanide";
- } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>4</sub><sup>-</sup>") {
- neg = "dihydrogen phosphate";
- } else if(mainGame::getNegComV() == "S<sub>2</sub>O<sub>8</sub><sup>2-</sup>") {
- neg = "peroxydisulfate";
- }
- }
- ui->answerLabel->setText(pos + " " + neg);
- }
- show();
- }
Add Comment
Please, Sign In to add comment