Guest User

Untitled

a guest
Dec 11th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.73 KB | None | 0 0
  1. #include "answer.h"
  2. #include "ui_answer.h"
  3. #include "maingame.h"
  4.  
  5. Answer::Answer(QWidget *parent) :
  6. QDialog(parent),
  7. mode(0),
  8. ui(new Ui::Answer)
  9. {
  10. ui->setupUi(this);
  11. this->setWindowTitle("Answer!");
  12. connect(ui->answerBox, SIGNAL(clicked(QAbstractButton*)), ui->answerLabel, SLOT(clear()));
  13. }
  14.  
  15. Answer::~Answer()
  16. {
  17. delete ui;
  18. }
  19.  
  20. void Answer::setMode(int index) {
  21. this->mode = index;
  22. }
  23.  
  24. void Answer::setAnswer() {
  25. QString pos;
  26. QString neg;
  27.  
  28. if(this->mode == 0) {
  29. //Hydracids
  30. if(mainGame::getNegHydraV() == "F<sup>-</sup><sub>(aq)</sub>") {
  31. neg = "hydrofluoric acid";
  32. } else if(mainGame::getNegHydraV() == "F<sup>-</sup><sub>(g)</sub>") {
  33. neg = "hydrogen fluoride";
  34. } else if(mainGame::getNegHydraV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
  35. neg = "hydrochloric acid";
  36. } else if(mainGame::getNegHydraV() == "Cl<sup>-</sup><sub>(g)</sub>") {
  37. neg = "hydrogen chloride";
  38. } else if(mainGame::getNegHydraV() == "Br<sup>-</sup><sub>(aq)</sub>") {
  39. neg = "hydrobromic acid";
  40. } else if(mainGame::getNegHydraV() == "Br<sup>-</sup><sub>(g)</sub>") {
  41. neg = "hydrogen bromide";
  42. } else if(mainGame::getNegHydraV() == "I<sup>-</sup><sub>(aq)</sub>") {
  43. neg = "hydroiodic acid";
  44. } else if(mainGame::getNegHydraV() == "I<sup>-</sup><sub>(g)</sub>") {
  45. neg = "hydrogen iodide";
  46. } else if(mainGame::getNegHydraV() == "CN<sup>-</sup><sub>(aq)</sub>") {
  47. neg = "hydrocyanic acid";
  48. } else if(mainGame::getNegHydraV() == "CN<sup>-</sup><sub>(g)</sub>") {
  49. neg = "hydrogen cyanide";
  50. } else if(mainGame::getNegHydraV() == "S<sup>-</sup><sub>(aq)</sub>") {
  51. neg = "hydrosulfuric acid";
  52. } else if(mainGame::getNegHydraV() == "S<sup>-</sup><sub>(g)</sub>") {
  53. neg = "hydrogen sulfide";
  54. }
  55.  
  56. ui->answerLabel->setText(neg);
  57. } else if(this->mode == 1) {
  58. if(mainGame::getPosSaltV() == "Ca<sup>2+</sup>") {
  59. pos = "calcium";
  60. } else if(mainGame::getPosSaltV() == "Na<sup>+</sup>") {
  61. pos = "sodium";
  62. } else if(mainGame::getPosSaltV() == "Cs<sup>+</sup>" ) {
  63. pos = "cesium";
  64. } else if(mainGame::getPosSaltV() == "Li<sup>+</sup>") {
  65. pos = "lithium";
  66. } else if(mainGame::getPosSaltV() == "K<sup>+</sup>") {
  67. pos = "potassium";
  68. } else if(mainGame::getPosSaltV() == "Rb<sup>+</sup>") {
  69. pos = "rubidium";
  70. } else if(mainGame::getPosSaltV() == "Fr<sup>+</sup>") {
  71. pos = "francium";
  72. } else if(mainGame::getPosSaltV() == "Be<sup>2+</sup>") {
  73. pos = "beryllium";
  74. } else if(mainGame::getPosSaltV() == "Mg<sup>2+</sup>") {
  75. pos = "magnesium";
  76. } else if(mainGame::getPosSaltV() == "Sr<sup>2+</sup>") {
  77. pos = "strontium";
  78. } else if(mainGame::getPosSaltV() == "Ba<sup>2+</sup>") {
  79. pos = "barium";
  80. } else if(mainGame::getPosSaltV() == "Ra<sup>2+</sup>") {
  81. pos = "radium";
  82. } else if(mainGame::getPosSaltV() == "Al<sup>3+</sup>") {
  83. pos = "aluminum";
  84. } else if(mainGame::getPosSaltV() == "Ga<sup>3+</sup>") {
  85. pos = "gallium";
  86. } else if(mainGame::getPosSaltV() == "Ge<sup>3+</sup>") {
  87. pos = "germanium";
  88. } else if(mainGame::getPosSaltV() == "H<sup>+</sup>") {
  89. pos = "hydrogen";
  90. }
  91.  
  92. if(mainGame::getNegSaltV() == "C<sup>4-</sup>") {
  93. neg = "carbide";
  94. } else if(mainGame::getNegSaltV() == "N<sup>3-</sup>") {
  95. neg = "nitride";
  96. } else if(mainGame::getNegSaltV() == "O<sup>2-</sup>") {
  97. neg = "oxide";
  98. } else if(mainGame::getNegSaltV() == "P<sup>3-</sup>") {
  99. neg = "phosphide";
  100. } else if(mainGame::getNegSaltV() == "S<sup>2-</sup>") {
  101. neg = "sulfide";
  102. } else if(mainGame::getNegSaltV() == "Se<sup>2-</sup>") {
  103. neg = "selenide";
  104. } else if(mainGame::getNegSaltV() == "F<sup>-</sup>") {
  105. neg = "fluoride";
  106. } else if(mainGame::getNegSaltV() == "Cl<sup>-</sup>") {
  107. neg = "chloride";
  108. } else if(mainGame::getNegSaltV() == "Br<sup>-</sup>") {
  109. neg = "bromide";
  110. } else if(mainGame::getNegSaltV() == "I<sup>-</sup>") {
  111. neg = "iodide";
  112. } else if(mainGame::getNegSaltV() == "CN<sup>-</sup>") {
  113. neg = "cyanide";
  114. }
  115.  
  116. ui->answerLabel->setText(pos + " " + neg);
  117.  
  118. } else if(this->mode == 2) {
  119. //Hydracids/Salts
  120. if(!(mainGame::getPosHydraSaltV() == "H<sup>+</sup>")) {
  121. if(mainGame::getPosHydraSaltV() == "Ca<sup>2+</sup>") {
  122. pos = "calcium";
  123. } else if(mainGame::getPosHydraSaltV() == "Na<sup>+</sup>") {
  124. pos = "sodium";
  125. } else if(mainGame::getPosHydraSaltV() == "Cs<sup>+</sup>" ) {
  126. pos = "cesium";
  127. } else if(mainGame::getPosHydraSaltV() == "Li<sup>+</sup>") {
  128. pos = "lithium";
  129. } else if(mainGame::getPosHydraSaltV() == "K<sup>+</sup>") {
  130. pos = "potassium";
  131. } else if(mainGame::getPosHydraSaltV() == "Rb<sup>+</sup>") {
  132. pos = "rubidium";
  133. } else if(mainGame::getPosHydraSaltV() == "Fr<sup>+</sup>") {
  134. pos = "francium";
  135. } else if(mainGame::getPosHydraSaltV() == "Be<sup>2+</sup>") {
  136. pos = "beryllium";
  137. } else if(mainGame::getPosHydraSaltV() == "Mg<sup>2+</sup>") {
  138. pos = "magnesium";
  139. } else if(mainGame::getPosHydraSaltV() == "Sr<sup>2+</sup>") {
  140. pos = "strontium";
  141. } else if(mainGame::getPosHydraSaltV() == "Ba<sup>2+</sup>") {
  142. pos = "barium";
  143. } else if(mainGame::getPosHydraSaltV() == "Ra<sup>2+</sup>") {
  144. pos = "radium";
  145. } else if(mainGame::getPosHydraSaltV() == "Al<sup>3+</sup>") {
  146. pos = "aluminum";
  147. } else if(mainGame::getPosHydraSaltV() == "Ga<sup>3+</sup>") {
  148. pos = "gallium";
  149. } else if(mainGame::getPosHydraSaltV() == "Ge<sup>3+</sup>") {
  150. pos = "germanium";
  151. }
  152.  
  153. if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(aq)</sub>") {
  154. neg = "fluoride";
  155. } else if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(g)</sub>") {
  156. neg = "fluoride";
  157. } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
  158. neg = "chloride";
  159. } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(g)</sub>") {
  160. neg = "chloride";
  161. } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(aq)</sub>") {
  162. neg = "bromide";
  163. } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(g)</sub>") {
  164. neg = "bromide";
  165. } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(aq)</sub>") {
  166. neg = "iodide";
  167. } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(g)</sub>") {
  168. neg = "iodide";
  169. } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(aq)</sub>") {
  170. neg = "cyanide";
  171. } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(g)</sub>") {
  172. neg = "cyanide";
  173. } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(aq)</sub>") {
  174. neg = "sulfide";
  175. } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(g)</sub>") {
  176. neg = "sulfide";
  177. }
  178.  
  179. ui->answerLabel->setText(pos + " " + neg);
  180. } else {
  181. if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(aq)</sub>") {
  182. neg = "hydrofluoric acid";
  183. } else if(mainGame::getNegHydraSaltV() == "F<sup>-</sup><sub>(g)</sub>") {
  184. neg = "hydrogen fluoride";
  185. } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(aq)</sub>") {
  186. neg = "hydrochloric acid";
  187. } else if(mainGame::getNegHydraSaltV() == "Cl<sup>-</sup><sub>(g)</sub>") {
  188. neg = "hydrogen chloride";
  189. } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(aq)</sub>") {
  190. neg = "hydrobromic acid";
  191. } else if(mainGame::getNegHydraSaltV() == "Br<sup>-</sup><sub>(g)</sub>") {
  192. neg = "hydrogen bromide";
  193. } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(aq)</sub>") {
  194. neg = "hydroiodic acid";
  195. } else if(mainGame::getNegHydraSaltV() == "I<sup>-</sup><sub>(g)</sub>") {
  196. neg = "hydrogen iodide";
  197. } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(aq)</sub>") {
  198. neg = "hydrocyanic acid";
  199. } else if(mainGame::getNegHydraSaltV() == "CN<sup>-</sup><sub>(g)</sub>") {
  200. neg = "hydrogen cyanide";
  201. } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(aq)</sub>") {
  202. neg = "hydrosulfuric acid";
  203. } else if(mainGame::getNegHydraSaltV() == "S<sup>-</sup><sub>(g)</sub>") {
  204. neg = "hydrogen sulfide";
  205. }
  206.  
  207. ui->answerLabel->setText(neg);
  208. }
  209. } else if(this->mode == 3) {
  210. if(mainGame::getNegOxoV() == "CO<sub>3</sub><sup>2-</sup>") {
  211. neg = "carbonic acid";
  212. } else if(mainGame::getNegOxoV() == "NO<sub>2</sub><sup>-</sup>") {
  213. neg = "nitrous acid";
  214. } else if(mainGame::getNegOxoV() == "NO<sub>3</sub><sup>-</sup>") {
  215. neg = "nitric acid";
  216. } else if(mainGame::getNegOxoV() == "PO<sub>4</sub><sup>3-</sup>") {
  217. neg = "phosphoric acid";
  218. } else if(mainGame::getNegOxoV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
  219. neg = "acetic acid";
  220. } else if(mainGame::getNegOxoV() == "BrO<sub>2</sub><sup>-</sup>") {
  221. neg = "bromous acid";
  222. } else if(mainGame::getNegOxoV() == "SO<sub>3</sub><sup>2-</sup>") {
  223. neg = "sulfurous acid";
  224. } else if(mainGame::getNegOxoV() == "SO<sub>4</sub><sup>2-</sup>") {
  225. neg = "sulfuric acid";
  226. } else if(mainGame::getNegOxoV() == "PO<sub>3</sub><sup>3-</sup>") {
  227. neg = "phosphorous acid";
  228. } else if(mainGame::getNegOxoV() == "ClO<sup>-</sup>") {
  229. neg = "hypochlorous acid";
  230. } else if(mainGame::getNegOxoV() == "ClO<sub>2</sub><sup>-</sup>") {
  231. neg = "chlorous acid";
  232. } else if(mainGame::getNegOxoV() == "ClO<sub>3</sub><sup>-</sup>") {
  233. neg = "chloric acid";
  234. } else if(mainGame::getNegOxoV() == "ClO<sub>4</sub><sup>-</sup>") {
  235. neg = "perchloric acid";
  236. } else if(mainGame::getNegOxoV() == "BrO<sup>-</sup>") {
  237. neg = "hypobromous acid";
  238. } else if(mainGame::getNegOxoV() == "BrO<sub>3</sub><sup>-</sup>") {
  239. neg = "bromic acid";
  240. } else if(mainGame::getNegOxoV() == "BrO<sub>4</sub><sup>-</sup>") {
  241. neg = "perbromic acid";
  242. } else if(mainGame::getNegOxoV() == "IO<sup>-</sup>") {
  243. neg = "hypoiodous";
  244. } else if(mainGame::getNegOxoV() == "IO<sub>2</sub><sup>-</sup>") {
  245. neg = "iodous acid";
  246. } else if(mainGame::getNegOxoV() == "IO<sub>3</sub><sup>-</sup>") {
  247. neg = "iodic acid";
  248. } else if(mainGame::getNegOxoV() == "IO<sub>4</sub><sup>-</sup>") {
  249. neg = "periodic acid";
  250. } else if(mainGame::getNegOxoV() == "BO<sub>3</sub><sup>3-</sup>") {
  251. neg = "boric acid";
  252. } else if(mainGame::getNegOxoV() == "CrO<sub>4</sub><sup>2-</sup>") {
  253. neg = "chromic acid";
  254. }
  255.  
  256. ui->answerLabel->setText(neg);
  257. } else if(this->mode == 4) {
  258. //Oxoacids/Salts
  259. if(!(mainGame::getPosOxoSaltV() == "H<sup>+</sup>")) {
  260. /*START POSITIVES*/
  261. if(mainGame::getPosOxoSaltV() == "Ca<sup>2+</sup>") {
  262. pos = "calcium";
  263. } else if(mainGame::getPosOxoSaltV() == "Na<sup>+</sup>") {
  264. pos = "sodium";
  265. } else if(mainGame::getPosOxoSaltV() == "Cs<sup>+</sup>" ) {
  266. pos = "cesium";
  267. } else if(mainGame::getPosOxoSaltV() == "Pb<sup>4+</sup>") {
  268. pos = "lead (IV)";
  269. } else if(mainGame::getPosOxoSaltV() == "Pb<sup>2+</sup>") {
  270. pos = "lead (II)";
  271. } else if(mainGame::getPosOxoSaltV() == "Li<sup>+</sup>") {
  272. pos = "lithium";
  273. } else if(mainGame::getPosOxoSaltV() == "K<sup>+</sup>") {
  274. pos = "potassium";
  275. } else if(mainGame::getPosOxoSaltV() == "Rb<sup>+</sup>") {
  276. pos = "rubidium";
  277. } else if(mainGame::getPosOxoSaltV() == "Fr<sup>+</sup>") {
  278. pos = "francium";
  279. } else if(mainGame::getPosOxoSaltV() == "Be<sup>2+</sup>") {
  280. pos = "beryllium";
  281. } else if(mainGame::getPosOxoSaltV() == "Mg<sup>2+</sup>") {
  282. pos = "magnesium";
  283. } else if(mainGame::getPosOxoSaltV() == "Sr<sup>2+</sup>") {
  284. pos = "strontium";
  285. } else if(mainGame::getPosOxoSaltV() == "Ba<sup>2+</sup>") {
  286. pos = "barium";
  287. } else if(mainGame::getPosOxoSaltV() == "Ra<sup>2+</sup>") {
  288. pos = "radium";
  289. } else if(mainGame::getPosOxoSaltV() == "Cr<sup>2+</sup>") {
  290. pos = "chromium (II)";
  291. } else if(mainGame::getPosOxoSaltV() == "Cr<sup>3+</sup>") {
  292. pos = "chromium (III)";
  293. } else if(mainGame::getPosOxoSaltV() == "Fe<sup>2+</sup>") {
  294. pos = "iron (II)";
  295. } else if(mainGame::getPosOxoSaltV() == "Fe<sup>3+</sup>") {
  296. pos = "iron (III)";
  297. } else if(mainGame::getPosOxoSaltV() == "Co<sup>2+</sup>") {
  298. pos = "cobalt (II)";
  299. } else if(mainGame::getPosOxoSaltV() == "Co<sup>3+</sup>") {
  300. pos = "cobalt (III)";
  301. } else if(mainGame::getPosOxoSaltV() == "Cu<sup>+</sup>") {
  302. pos = "copper (I)";
  303. } else if(mainGame::getPosOxoSaltV() == "Cu<sup>2+</sup>") {
  304. pos = "copper (II)";
  305. } else if(mainGame::getPosOxoSaltV() == "Ag<sup>+</sup>") {
  306. pos = "silver";
  307. } else if(mainGame::getPosOxoSaltV() == "Hg<sup>2+</sup>") {
  308. pos = "mercury (II)";
  309. } else if(mainGame::getPosOxoSaltV() == "Al<sup>3+</sup>") {
  310. pos = "aluminum";
  311. } else if(mainGame::getPosOxoSaltV() == "Ga<sup>3+</sup>") {
  312. pos = "gallium";
  313. } else if(mainGame::getPosOxoSaltV() == "Ge<sup>3+</sup>") {
  314. pos = "germanium";
  315. } else if(mainGame::getPosOxoSaltV() == "Sn<sup>2+</sup>") {
  316. pos = "tin (II)";
  317. } else if(mainGame::getPosOxoSaltV() == "Sn<sup>4+</sup>") {
  318. pos = "tin (IV)";
  319. } else if(mainGame::getPosOxoSaltV() == "Zn<sup>2+</sup>") {
  320. pos = "zinc";
  321. }
  322. /*END POSITIVES*/
  323.  
  324. /*START NEGATIVES*/
  325. if(mainGame::getNegOxoSaltV() == "CO<sub>3</sub><sup>2-</sup>") {
  326. neg = "carbonate";
  327. } else if(mainGame::getNegOxoSaltV() == "NO<sub>2</sub><sup>-</sup>") {
  328. neg = "nitrite";
  329. } else if(mainGame::getNegOxoSaltV() == "NO<sub>3</sub><sup>-</sup>") {
  330. neg = "nitrate";
  331. } else if(mainGame::getNegOxoSaltV() == "PO<sub>4</sub><sup>3-</sup>") {
  332. neg = "phosphate";
  333. } else if(mainGame::getNegOxoSaltV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
  334. neg = "acetate";
  335. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>2</sub><sup>-</sup>") {
  336. neg = "bromite";
  337. } else if(mainGame::getNegOxoSaltV() == "SO<sub>3</sub><sup>2-</sup>") {
  338. neg = "sulfite";
  339. } else if(mainGame::getNegOxoSaltV() == "SO<sub>4</sub><sup>2-</sup>") {
  340. neg = "sulfate";
  341. } else if(mainGame::getNegOxoSaltV() == "PO<sub>3</sub><sup>3-</sup>") {
  342. neg = "phosphite";
  343. } else if(mainGame::getNegOxoSaltV() == "ClO<sup>-</sup>") {
  344. neg = "hypochlorite";
  345. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>2</sub><sup>-</sup>") {
  346. neg = "chlorite";
  347. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>3</sub><sup>-</sup>") {
  348. neg = "chlorate";
  349. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>4</sub><sup>-</sup>") {
  350. neg = "perchlorate";
  351. } else if(mainGame::getNegOxoSaltV() == "BrO<sup>-</sup>") {
  352. neg = "hypobromite";
  353. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>3</sub><sup>-</sup>") {
  354. neg = "bromate";
  355. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>4</sub><sup>-</sup>") {
  356. neg = "perbromate";
  357. } else if(mainGame::getNegOxoSaltV() == "IO<sup>-</sup>") {
  358. neg = "hypoiodite";
  359. } else if(mainGame::getNegOxoSaltV() == "IO<sub>2</sub><sup>-</sup>") {
  360. neg = "iodite";
  361. } else if(mainGame::getNegOxoSaltV() == "IO<sub>3</sub><sup>-</sup>") {
  362. neg = "iodate";
  363. } else if(mainGame::getNegOxoSaltV() == "IO<sub>4</sub><sup>-</sup>") {
  364. neg = "periodate";
  365. } else if(mainGame::getNegOxoSaltV() == "BO<sub>3</sub><sup>3-</sup>") {
  366. neg = "borate";
  367. } else if(mainGame::getNegOxoSaltV() == "CrO<sub>4</sub><sup>2-</sup>") {
  368. neg = "chromate";
  369. }
  370. /*END NEGATIVES*/
  371.  
  372. ui->answerLabel->setText(pos + " " + neg);
  373. } else if(mainGame::getPosOxoSaltV() == "H<sup>+</sup>") {
  374. if(mainGame::getNegOxoSaltV() == "CO<sub>3</sub><sup>2-</sup>") {
  375. neg = "carbonic acid";
  376. } else if(mainGame::getNegOxoSaltV() == "NO<sub>2</sub><sup>-</sup>") {
  377. neg = "nitrous acid";
  378. } else if(mainGame::getNegOxoSaltV() == "NO<sub>3</sub><sup>-</sup>") {
  379. neg = "nitric acid";
  380. } else if(mainGame::getNegOxoSaltV() == "PO<sub>4</sub><sup>3-</sup>") {
  381. neg = "phosphoric acid";
  382. } else if(mainGame::getNegOxoSaltV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
  383. neg = "acetic acid";
  384. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>2</sub><sup>-</sup>") {
  385. neg = "bromous acid";
  386. } else if(mainGame::getNegOxoSaltV() == "SO<sub>3</sub><sup>2-</sup>") {
  387. neg = "sulfurous acid";
  388. } else if(mainGame::getNegOxoSaltV() == "SO<sub>4</sub><sup>2-</sup>") {
  389. neg = "sulfuric acid";
  390. } else if(mainGame::getNegOxoSaltV() == "PO<sub>3</sub><sup>3-</sup>") {
  391. neg = "phosphorous acid";
  392. } else if(mainGame::getNegOxoSaltV() == "ClO<sup>-</sup>") {
  393. neg = "hypochlorous acid";
  394. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>2</sub><sup>-</sup>") {
  395. neg = "chlorous acid";
  396. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>3</sub><sup>-</sup>") {
  397. neg = "chloric acid";
  398. } else if(mainGame::getNegOxoSaltV() == "ClO<sub>4</sub><sup>-</sup>") {
  399. neg = "perchloric acid";
  400. } else if(mainGame::getNegOxoSaltV() == "BrO<sup>-</sup>") {
  401. neg = "hypobromous acid";
  402. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>3</sub><sup>-</sup>") {
  403. neg = "bromic acid";
  404. } else if(mainGame::getNegOxoSaltV() == "BrO<sub>4</sub><sup>-</sup>") {
  405. neg = "perbromic acid";
  406. } else if(mainGame::getNegOxoSaltV() == "IO<sup>-</sup>") {
  407. neg = "hypoiodous";
  408. } else if(mainGame::getNegOxoSaltV() == "IO<sub>2</sub><sup>-</sup>") {
  409. neg = "iodous acid";
  410. } else if(mainGame::getNegOxoSaltV() == "IO<sub>3</sub><sup>-</sup>") {
  411. neg = "iodic acid";
  412. } else if(mainGame::getNegOxoSaltV() == "IO<sub>4</sub><sup>-</sup>") {
  413. neg = "periodic acid";
  414. } else if(mainGame::getNegOxoSaltV() == "BO<sub>3</sub><sup>3-</sup>") {
  415. neg = "boric acid";
  416. } else if(mainGame::getNegOxoSaltV() == "CrO<sub>4</sub><sup>2-</sup>") {
  417. neg = "chromic acid";
  418. }
  419.  
  420. ui->answerLabel->setText(neg);
  421. }
  422. } else if(this->mode == 5) {
  423. if(mainGame::getPosMotV() == "Pb<sup>4+</sup>") {
  424. pos = "lead (IV)";
  425. } else if(mainGame::getPosMotV() == "Pb<sup>2+</sup>") {
  426. pos = "lead (II)";
  427. } else if(mainGame::getPosMotV() == "Cr<sup>2+</sup>") {
  428. pos = "chromium (II)";
  429. } else if(mainGame::getPosMotV() == "Cr<sup>3+</sup>") {
  430. pos = "chromium (III)";
  431. } else if(mainGame::getPosMotV() == "Fe<sup>2+</sup>") {
  432. pos = "iron (II)";
  433. } else if(mainGame::getPosMotV() == "Fe<sup>3+</sup>") {
  434. pos = "iron (III)";
  435. } else if(mainGame::getPosMotV() == "Co<sup>2+</sup>") {
  436. pos = "cobalt (II)";
  437. } else if(mainGame::getPosMotV() == "Co<sup>3+</sup>") {
  438. pos = "cobalt (III)";
  439. } else if(mainGame::getPosMotV() == "Cu<sup>+</sup>") {
  440. pos = "copper (I)";
  441. } else if(mainGame::getPosMotV() == "Cu<sup>2+</sup>") {
  442. pos = "copper (II)";
  443. } else if(mainGame::getPosMotV() == "Ag<sup>+</sup>") {
  444. pos = "silver";
  445. } else if(mainGame::getPosMotV() == "Hg<sup>2+</sup>") {
  446. pos = "mercury (II)";
  447. } else if(mainGame::getPosMotV() == "Sn<sup>2+</sup>") {
  448. pos = "tin (II)";
  449. } else if(mainGame::getPosMotV() == "Sn<sup>4+</sup>") {
  450. pos = "tin (IV)";
  451. } else if(mainGame::getPosMotV() == "Zn<sup>2+</sup>") {
  452. pos = "zinc";
  453. }
  454.  
  455. if(mainGame::getNegMotV() == "C<sup>4-</sup>") {
  456. neg = "carbide";
  457. } else if(mainGame::getNegMotV() == "N<sup>3-</sup>") {
  458. neg = "nitride";
  459. } else if(mainGame::getNegMotV() == "O<sup>2-</sup>") {
  460. neg = "oxide";
  461. } else if(mainGame::getNegMotV() == "P<sup>3-</sup>") {
  462. neg = "phosphide";
  463. } else if(mainGame::getNegMotV() == "S<sup>2-</sup>") {
  464. neg = "sulfide";
  465. } else if(mainGame::getNegMotV() == "Se<sup>2-</sup>") {
  466. neg = "selenide";
  467. } else if(mainGame::getNegMotV() == "F<sup>-</sup>") {
  468. neg = "fluoride";
  469. } else if(mainGame::getNegMotV() == "Cl<sup>-</sup>") {
  470. neg = "chloride";
  471. } else if(mainGame::getNegMotV() == "Br<sup>-</sup>") {
  472. neg = "bromide";
  473. } else if(mainGame::getNegMotV() == "I<sup>-</sup>") {
  474. neg = "iodide";
  475. } else if(mainGame::getNegMotV() == "CN<sup>-</sup>") {
  476. neg = "cyanide";
  477. } else if(mainGame::getNegMotV() == "CO<sub>3</sub><sup>2-</sup>") {
  478. neg = "carbonate";
  479. } else if(mainGame::getNegMotV() == "NO<sub>2</sub><sup>-</sup>") {
  480. neg = "nitrite";
  481. } else if(mainGame::getNegMotV() == "NO<sub>3</sub><sup>-</sup>") {
  482. neg = "nitrate";
  483. } else if(mainGame::getNegMotV() == "PO<sub>4</sub><sup>3-</sup>") {
  484. neg = "phosphate";
  485. } else if(mainGame::getNegMotV() == "CH<sub>3</sub>C</sub>O<sub>2</sub><sup>-</sup>") {
  486. neg = "acetate";
  487. } else if(mainGame::getNegMotV() == "BrO<sub>2</sub><sup>-</sup>") {
  488. neg = "bromite";
  489. } else if(mainGame::getNegMotV() == "SO<sub>3</sub><sup>2-</sup>") {
  490. neg = "sulfite";
  491. } else if(mainGame::getNegMotV() == "SO<sub>4</sub><sup>2-</sup>") {
  492. neg = "sulfate";
  493. } else if(mainGame::getNegMotV() == "PO<sub>3</sub><sup>3-</sup>") {
  494. neg = "phosphite";
  495. } else if(mainGame::getNegMotV() == "ClO<sup>-</sup>") {
  496. neg = "hypochlorite";
  497. } else if(mainGame::getNegMotV() == "ClO<sub>2</sub><sup>-</sup>") {
  498. neg = "chlorite";
  499. } else if(mainGame::getNegMotV() == "ClO<sub>3</sub><sup>-</sup>") {
  500. neg = "chlorate";
  501. } else if(mainGame::getNegMotV() == "ClO<sub>4</sub><sup>-</sup>") {
  502. neg = "perchlorate";
  503. } else if(mainGame::getNegMotV() == "BrO<sup>-</sup>") {
  504. neg = "hypobromite";
  505. } else if(mainGame::getNegMotV() == "BrO<sub>3</sub><sup>-</sup>") {
  506. neg = "bromate";
  507. } else if(mainGame::getNegMotV() == "BrO<sub>4</sub><sup>-</sup>") {
  508. neg = "perbromate";
  509. } else if(mainGame::getNegMotV() == "IO<sup>-</sup>") {
  510. neg = "hypoiodite";
  511. } else if(mainGame::getNegMotV() == "IO<sub>2</sub><sup>-</sup>") {
  512. neg = "iodite";
  513. } else if(mainGame::getNegMotV() == "IO<sub>3</sub><sup>-</sup>") {
  514. neg = "iodate";
  515. } else if(mainGame::getNegMotV() == "IO<sub>4</sub><sup>-</sup>") {
  516. neg = "periodate";
  517. } else if(mainGame::getNegMotV() == "BO<sub>3</sub><sup>3-</sup>") {
  518. neg = "borate";
  519. } else if(mainGame::getNegMotV() == "CrO<sub>4</sub><sup>2-</sup>") {
  520. neg = "chromate";
  521. }
  522.  
  523. ui->answerLabel->setText(pos + " " + neg);
  524. } else if(this->mode == 6) {
  525. if(mainGame::getPosOxHyV() == "Ca<sup>2+</sup>") {
  526. pos = "calcium";
  527. } else if(mainGame::getPosOxHyV() == "Na<sup>+</sup>") {
  528. pos = "sodium";
  529. } else if(mainGame::getPosOxHyV() == "Cs<sup>+</sup>" ) {
  530. pos = "cesium";
  531. } else if(mainGame::getPosOxHyV() == "Pb<sup>4+</sup>") {
  532. pos = "lead (IV)";
  533. } else if(mainGame::getPosOxHyV() == "Pb<sup>2+</sup>") {
  534. pos = "lead (II)";
  535. } else if(mainGame::getPosOxHyV() == "Li<sup>+</sup>") {
  536. pos = "lithium";
  537. } else if(mainGame::getPosOxHyV() == "K<sup>+</sup>") {
  538. pos = "potassium";
  539. } else if(mainGame::getPosOxHyV() == "Rb<sup>+</sup>") {
  540. pos = "rubidium";
  541. } else if(mainGame::getPosOxHyV() == "Fr<sup>+</sup>") {
  542. pos = "francium";
  543. } else if(mainGame::getPosOxHyV() == "Be<sup>2+</sup>") {
  544. pos = "beryllium";
  545. } else if(mainGame::getPosOxHyV() == "Mg<sup>2+</sup>") {
  546. pos = "magnesium";
  547. } else if(mainGame::getPosOxHyV() == "Sr<sup>2+</sup>") {
  548. pos = "strontium";
  549. } else if(mainGame::getPosOxHyV() == "Ba<sup>2+</sup>") {
  550. pos = "barium";
  551. } else if(mainGame::getPosOxHyV() == "Ra<sup>2+</sup>") {
  552. pos = "radium";
  553. } else if(mainGame::getPosOxHyV() == "Cr<sup>2+</sup>") {
  554. pos = "chromium (II)";
  555. } else if(mainGame::getPosOxHyV() == "Cr<sup>3+</sup>") {
  556. pos = "chromium (III)";
  557. } else if(mainGame::getPosOxHyV() == "Fe<sup>2+</sup>") {
  558. pos = "iron (II)";
  559. } else if(mainGame::getPosOxHyV() == "Fe<sup>3+</sup>") {
  560. pos = "iron (III)";
  561. } else if(mainGame::getPosOxHyV() == "Co<sup>2+</sup>") {
  562. pos = "cobalt (II)";
  563. } else if(mainGame::getPosOxHyV() == "Co<sup>3+</sup>") {
  564. pos = "cobalt (III)";
  565. } else if(mainGame::getPosOxHyV() == "Cu<sup>+</sup>") {
  566. pos = "copper (I)";
  567. } else if(mainGame::getPosOxHyV() == "Cu<sup>2+</sup>") {
  568. pos = "copper (II)";
  569. } else if(mainGame::getPosOxHyV() == "Ag<sup>+</sup>") {
  570. pos = "silver";
  571. } else if(mainGame::getPosOxHyV() == "Hg<sup>2+</sup>") {
  572. pos = "mercury (II)";
  573. } else if(mainGame::getPosOxHyV() == "Al<sup>3+</sup>") {
  574. pos = "aluminum";
  575. } else if(mainGame::getPosOxHyV() == "Ga<sup>3+</sup>") {
  576. pos = "gallium";
  577. } else if(mainGame::getPosOxHyV() == "Ge<sup>3+</sup>") {
  578. pos = "germanium";
  579. } else if(mainGame::getPosOxHyV() == "Sn<sup>2+</sup>") {
  580. pos = "tin (II)";
  581. } else if(mainGame::getPosOxHyV() == "Sn<sup>4+</sup>") {
  582. pos = "tin (IV)";
  583. } else if(mainGame::getPosOxHyV() == "Zn<sup>2+</sup>") {
  584. pos = "zinc";
  585. }
  586.  
  587.  
  588. if(mainGame::getNegOxHyV() == "H<sup>-</sup>") {
  589. neg = "hydride";
  590. } else if(mainGame::getNegOxHyV() == "O<sup>2-</sup>") {
  591. neg = "oxide";
  592. } else if(mainGame::getNegOxHyV() == "O<sub>2</sub><sup>2-</sup>") {
  593. neg = "peroxide";
  594. }
  595.  
  596. ui->answerLabel->setText(pos + " " + neg);
  597. } else if(this->mode == 7) {
  598. if(mainGame::getPosComV() == "Ca<sup>2+</sup>") {
  599. pos = "calcium";
  600. } else if(mainGame::getPosComV() == "Na<sup>+</sup>") {
  601. pos = "sodium";
  602. } else if(mainGame::getPosComV() == "Cs<sup>+</sup>" ) {
  603. pos = "cesium";
  604. } else if(mainGame::getPosComV() == "Pb<sup>4+</sup>") {
  605. pos = "lead (IV)";
  606. } else if(mainGame::getPosComV() == "Pb<sup>2+</sup>") {
  607. pos = "lead (II)";
  608. } else if(mainGame::getPosComV() == "Li<sup>+</sup>") {
  609. pos = "lithium";
  610. } else if(mainGame::getPosComV() == "K<sup>+</sup>") {
  611. pos = "potassium";
  612. } else if(mainGame::getPosComV() == "Rb<sup>+</sup>") {
  613. pos = "rubidium";
  614. } else if(mainGame::getPosComV() == "Fr<sup>+</sup>") {
  615. pos = "francium";
  616. } else if(mainGame::getPosComV() == "Be<sup>2+</sup>") {
  617. pos = "beryllium";
  618. } else if(mainGame::getPosComV() == "Mg<sup>2+</sup>") {
  619. pos = "magnesium";
  620. } else if(mainGame::getPosComV() == "Sr<sup>2+</sup>") {
  621. pos = "strontium";
  622. } else if(mainGame::getPosComV() == "Ba<sup>2+</sup>") {
  623. pos = "barium";
  624. } else if(mainGame::getPosComV() == "Ra<sup>2+</sup>") {
  625. pos = "radium";
  626. } else if(mainGame::getPosComV() == "Cr<sup>2+</sup>") {
  627. pos = "chromium (II)";
  628. } else if(mainGame::getPosComV() == "Cr<sup>3+</sup>") {
  629. pos = "chromium (III)";
  630. } else if(mainGame::getPosComV() == "Fe<sup>2+</sup>") {
  631. pos = "iron (II)";
  632. } else if(mainGame::getPosComV() == "Fe<sup>3+</sup>") {
  633. pos = "iron (III)";
  634. } else if(mainGame::getPosComV() == "Co<sup>2+</sup>") {
  635. pos = "cobalt (II)";
  636. } else if(mainGame::getPosComV() == "Co<sup>3+</sup>") {
  637. pos = "cobalt (III)";
  638. } else if(mainGame::getPosComV() == "Cu<sup>+</sup>") {
  639. pos = "copper (I)";
  640. } else if(mainGame::getPosComV() == "Cu<sup>2+</sup>") {
  641. pos = "copper (II)";
  642. } else if(mainGame::getPosComV() == "Ag<sup>+</sup>") {
  643. pos = "silver";
  644. } else if(mainGame::getPosComV() == "Hg<sup>2+</sup>") {
  645. pos = "mercury (II)";
  646. } else if(mainGame::getPosComV() == "Al<sup>3+</sup>") {
  647. pos = "aluminum";
  648. } else if(mainGame::getPosComV() == "Ga<sup>3+</sup>") {
  649. pos = "gallium";
  650. } else if(mainGame::getPosComV() == "Ge<sup>3+</sup>") {
  651. pos = "germanium";
  652. } else if(mainGame::getPosComV() == "Sn<sup>2+</sup>") {
  653. pos = "tin (II)";
  654. } else if(mainGame::getPosComV() == "Sn<sup>4+</sup>") {
  655. pos = "tin (IV)";
  656. } else if(mainGame::getPosComV() == "Zn<sup>2+</sup>") {
  657. pos = "zinc";
  658. } else if(mainGame::getPosComV() == "H<sup>+</sup>") {
  659. pos = "hydrogen";
  660. }
  661.  
  662. if(mainGame::getPosComV() == "") {
  663. if(mainGame::getNegComV() == "HCO<sub>3</sub><sup>-</sup>") {
  664. neg = "bicarbonate";
  665. } else if(mainGame::getNegComV() == "HPO<sub>4</sub><sup>2-</sup>") {
  666. neg = "monohydrogen phospate";
  667. } else if(mainGame::getNegComV() == "HSO<sub>3</sub><sup>-</sup>") {
  668. neg = "hydrogen sulfite";
  669. } else if(mainGame::getNegComV() == "HSO<sub>4</sub><sup>-</sup>") {
  670. neg = "hydrogen sulfate";
  671. } else if(mainGame::getNegComV() == "HPO<sub>3</sub><sup>2-</sup>") {
  672. neg = "monohydrogen phosphite";
  673. } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>3</sub><sup>-</sup>") {
  674. neg = "dihydrogen phosphite";
  675. } else if(mainGame::getNegComV() == "HC<sub>2</sub>O<sub>4</sub><sup>-</sup>") {
  676. neg = "binoxalate";
  677. } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>4</sub><sup>-</sup>") {
  678. neg = "dihydrogen phosphate";
  679. }
  680. } else {
  681. if(mainGame::getNegComV() == "HCO<sub>3</sub><sup>-</sup>") {
  682. neg = "bicarbonate";
  683. } else if(mainGame::getNegComV() == "HPO<sub>4</sub><sup>2-</sup>") {
  684. neg = "monohydrogen phospate";
  685. } else if(mainGame::getNegComV() == "HSO<sub>3</sub><sup>-</sup>") {
  686. neg = "hydrogen sulfite";
  687. } else if(mainGame::getNegComV() == "HSO<sub>4</sub><sup>-</sup>") {
  688. neg = "hydrogen sulfate";
  689. } else if(mainGame::getNegComV() == "HPO<sub>3</sub><sup>2-</sup>") {
  690. neg = "monohydrogen phosphite";
  691. } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>3</sub><sup>-</sup>") {
  692. neg = "dihydrogen phosphite";
  693. } else if(mainGame::getNegComV() == "HC<sub>2</sub>O<sub>4</sub><sup>-</sup>") {
  694. neg = "binoxalate";
  695. } else if(mainGame::getNegComV() == "C<sub>2</sub>O<sub>4</sub><sup>2-</sup>") {
  696. neg = "oxalate";
  697. } else if(mainGame::getNegComV() == "P<sub>2</sub>O<sub>7</sub><sup>4-</sup>") {
  698. neg = "pyrophosphate";
  699. } else if(mainGame::getNegComV() == "MnO<sub>4</sub><sup>2-</sup>") {
  700. neg = "manganate";
  701. } else if(mainGame::getNegComV() == "MnO<sub>4</sub><sup>-</sup>") {
  702. neg = "permanganate";
  703. } else if(mainGame::getNegComV() == "S<sub>2</sub>O<sub>3</sub><sup>2-</sup>") {
  704. neg = "thiosulfate";
  705. } else if(mainGame::getNegComV() == "Cr<sub>2</sub>O<sub>7</sub><sup>2-</sup>") {
  706. neg = "dichromate";
  707. } else if(mainGame::getNegComV() == "Fe(CN)<sub>6</sub><sup>3-</sup>") {
  708. neg = "ferricyanide";
  709. } else if(mainGame::getNegComV() == "Fe(CN)<sub>6</sub><sup>4-</sup>") {
  710. neg = "ferrocyanide";
  711. } else if(mainGame::getNegComV() == "H<sub>2</sub>PO<sub>4</sub><sup>-</sup>") {
  712. neg = "dihydrogen phosphate";
  713. } else if(mainGame::getNegComV() == "S<sub>2</sub>O<sub>8</sub><sup>2-</sup>") {
  714. neg = "peroxydisulfate";
  715. }
  716. }
  717.  
  718. ui->answerLabel->setText(pos + " " + neg);
  719. }
  720. show();
  721. }
Add Comment
Please, Sign In to add comment