Advertisement
Guest User

chem

a guest
Mar 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.52 KB | None | 0 0
  1. function main()
  2.   display()
  3.   input = read()
  4.   if input == "Hydrogen" then
  5.     hydrogen()
  6.   elseif input == "hydrogen" then
  7.     hydrogen()
  8.   elseif input == "H" then
  9.     hydrogen()
  10.   elseif input == "Helium" then
  11.     helium()
  12.   elseif input == "helium" then
  13.     helium()
  14.   elseif input == "He" then
  15.     helium()
  16.   elseif input == "Lithium" then
  17.     lithium()
  18.   elseif input == "litium" then
  19.     lithium()
  20.   elseif input == "Li" then
  21.     lithium()
  22.   elseif input == "Beryllium" then
  23.     beryllium()
  24.   elseif input == "beryllium" then
  25.     beryllium()
  26.   elseif input == "Be" then
  27.     beryllium()
  28.   elseif input == "Boron" then
  29.     boron()
  30.   elseif input == "boron" then
  31.     boron()
  32.   elseif input == "B" then
  33.     boron()
  34.   elseif input == "Carbon" then
  35.     carbon()
  36.   elseif input == "carbon" then
  37.     carbon()
  38.   elseif input == "C" then
  39.     carbon()
  40.   elseif input == "Nitrogen" then
  41.     nitrogen()
  42.   elseif input == "nitrogen" then
  43.     nitrogen()
  44.   elseif input == "N" then
  45.     nitrogen()
  46.   elseif input == "Oxygen" then
  47.     oxygen()
  48.   elseif input == "oxygen" then
  49.     oxygen()
  50.   elseif input == "O" then
  51.     oxygen()
  52.   elseif input == "Fluorine" then
  53.     fluorine()
  54.   elseif input == "fluorine" then
  55.     fluorine()
  56.   elseif input == "F" then
  57.     fluorine()
  58.   elseif input == "Neon" then
  59.     neon()
  60.   elseif input == "neon" then
  61.     neon()
  62.   elseif input == "Ne" then
  63.     neon()
  64.   elseif input == "Sodium" then
  65.     sodium()
  66.   elseif input == "sodium" then
  67.     sodium()
  68.   elseif input == "Na" then
  69.     sodium()
  70.   elseif input == "Magnesium" then
  71.     magnesium()
  72.   elseif input == "magnesium" then
  73.     magnesium()
  74.   elseif input == "Mg" then
  75.     magnesium()
  76.   elseif input == "Aluminum" then
  77.     aluminum()
  78.   elseif input == "aluminum" then
  79.     aluminum()
  80.   elseif input == "Al" then
  81.     aluminum()
  82.   elseif input == "Silicon" then
  83.     silicon()
  84.   elseif input == "silicon" then
  85.     silicon()
  86.   elseif input == "Si" then
  87.     silicon()
  88.   elseif input == "Phosphorus" then
  89.     phosphorus()
  90.   elseif input == "phosphorus" then
  91.     phosphorus()
  92.   elseif input == "P" then
  93.     phosphorus()
  94.   elseif input == "Sulfur" then
  95.     sulfur()
  96.   elseif input == "sulfur" then
  97.     sulfur()
  98.   elseif input == "S" then
  99.     sulfur()
  100.   elseif input then
  101.     term.clear()
  102.     term.setCursorPos(1,1)
  103.     print("INVALID: PLEASE TRY AGAIN...")
  104.     sleep(2)
  105.     main()
  106.   end
  107. end
  108.  
  109. function display()
  110.   term.clear()
  111.   term.setCursorPos(1,1)
  112.   print("Chemistry Assistant 1.0 Alpha")
  113.   print("")
  114.   print("Element Name:")
  115.   write("> ")
  116. end
  117.  
  118. function sulfur()
  119. term.clear()
  120. term.setCursorPos(1,1)
  121. print[[
  122. Atomic Name: Sulfur
  123. Atomic Symbol: S
  124. Atomic #: 16
  125. Atomic Mass #: 32
  126. Group: 16 (6)
  127. Period: 3
  128. Element Category: Other Non-Metals
  129. Block: P-Block
  130. Electron Configuration: [Ne], 3s^2, 3p^4
  131. Electrons per Shell: 2,8,6
  132. Valence Electrons: 6
  133. ]]
  134. end
  135.  
  136. function phosphorus()
  137. term.clear()
  138. term.setCursorPos(1,1)
  139. print[[
  140. Atomic Name: Phosphorus
  141. Atomic Symbol: P
  142. Atomic #: 15
  143. Atomic Mass #: 31
  144. Group: 15 (5)
  145. Period: 3
  146. Element Category: Other Non-Metals
  147. Block: P-Block
  148. Electron Configuration: [Ne], 3s^2, 3p^3
  149. Electrons per Shell: 2,8,5
  150. Valence Electrons: 5
  151. ]]
  152. end
  153.  
  154. function silicon()
  155. term.clear()
  156. term.setCursorPos(1,1)
  157. print[[
  158. Atomic Name: Silicon
  159. Atomic Symbol: Si
  160. Atomic #: 14
  161. Atomic Mass #: 28
  162. Group: 14 (4)
  163. Period: 3
  164. Element Category: Metalloids
  165. Block: P-Block
  166. Electron Configuration: [Ne], 3s^2, 3p^2
  167. Electrons per Shell: 2,8,4
  168. Valence Electrons: 4
  169. ]]
  170. end
  171.  
  172. function aluminum()
  173. term.clear()
  174. term.setCursorPos(1,1)
  175. print[[
  176. Atomic Name: Aluminum
  177. Atomic Symbol: Al
  178. Atomic #: 13
  179. Atomic Mass #: 27
  180. Group: 13 (3)
  181. Period: 3
  182. Element Category: Post-Transition Metals
  183. Block: P-Block
  184. Electron Configuration: [Ne], 3s^2, 3p^1
  185. Electrons per Shell: 2,8,3
  186. Valence Electrons: 3
  187. ]]
  188. end
  189.  
  190. function magnesium()
  191. term.clear()
  192. term.setCursorPos(1,1)
  193. print[[
  194. Atomic Name: Magnesium
  195. Atomic Symbol: Mg
  196. Atomic #: 12
  197. Atomic Mass #: 24
  198. Group: 2
  199. Period: 3
  200. Element Category: Alkaline Earth Metals
  201. Block: S-Block
  202. Electron Configuration: [Ne], 3s^2
  203. Electrons per Shell: 2,8,2
  204. Valence Electrons: 2
  205. ]]
  206. end
  207.  
  208. function sodium()
  209. term.clear()
  210. term.setCursorPos(1,1)
  211. print[[
  212. Atomic Name: Sodium
  213. Atomic Symbol: Na
  214. Atomic #: 11
  215. Atomic Mass #: 23
  216. Group: 1
  217. Period: 3
  218. Element Category: Alkali Metals
  219. Block: S-Block
  220. Electron Configuration: [Ne], 3s^1
  221. Electrons per Shell: 2,8,1
  222. Valence Electrons: 1
  223. ]]
  224. end
  225.  
  226. function neon()
  227. term.clear()
  228. term.setCursorPos(1,1)
  229. print[[
  230. Atomic Name: Neon
  231. Atomic Symbol: Ne
  232. Atomic #: 10
  233. Atomic Mass #: 20
  234. Group: 18 (8)
  235. Period: 2
  236. Element Category: Noble Gasses
  237. Block: P-Block
  238. Electron Configuration: [He], 2s^2, 2p^6; [Ne]
  239. Electrons per Shell: 2,8
  240. Valence Electrons: 8
  241. ]]
  242. end
  243.  
  244. function fluorine()
  245. term.clear()
  246. term.setCursorPos(1,1)
  247. print[[
  248. Atomic Name: Fluorine
  249. Atomic Symbol: F
  250. Atomic #: 9
  251. Atomic Mass #: 19
  252. Group: 17 (7)
  253. Period: 2
  254. Element Category: Other Non-Metals
  255. Block: P-Block
  256. Electron Configuration: [He], 2s^2, 2p^5
  257. Electrons per Shell: 2,7
  258. Valence Electrons: 7
  259. ]]
  260. end
  261.  
  262. function oxygen()
  263. term.clear()
  264. term.setCursorPos(1,1)
  265. print[[
  266. Atomic Name: Oxygen
  267. Atomic Symbol: O
  268. Atomic #: 8
  269. Atomic Mass #: 16
  270. Group: 16 (6)
  271. Period: 2
  272. Element Category: Other Non-Metals
  273. Block: P-Block
  274. Electron Configuration: [He], 2s^2, 2p^4
  275. Electron(s) per Shell: 2,6
  276. Valence Electron(s): 6
  277. ]]
  278. end
  279.  
  280. function nitrogen()
  281. term.clear()
  282. term.setCursorPos(1,1)
  283. print[[
  284. Atomic Name: Nitrogen
  285. Atomic Symbol: N
  286. Atomic #: 7
  287. Atomic Mass #: 14
  288. Group: 15 (5)
  289. Period: 2
  290. Element Category: Other Non-Metals
  291. Block: P-Block
  292. Electron Configuration: [He], 2s^2, 2p^3
  293. Electron(s) per Shell: 2,5
  294. Valence Electron(s): 5
  295. ]]
  296. end
  297.  
  298. function carbon()
  299. term.clear()
  300. term.setCursorPos(1,1)
  301. print[[
  302. Atomic Name: Carbon
  303. Atomic Symbol: C
  304. Atomic #: 6
  305. Atomic Mass #: 12
  306. Group: 14 (4)
  307. Period: 2
  308. Element Category: Other Non-Metals
  309. Block: P-Block
  310. Electron Configuration: [He], 2s^2, 2p^2
  311. Electron(s) per Shell: 2,4
  312. Valence Electron(s): 4
  313. ]]
  314. end
  315.  
  316. function boron()
  317. term.clear()
  318. term.setCursorPos(1,1)
  319. print[[
  320. Atomic Name: Boron
  321. Atomic Symbol: B
  322. Atomic #: 5
  323. Atomic Mass #: 11
  324. Group: 13 (3)
  325. Period: 2
  326. Element Category: Metalloids
  327. Block: P-Block
  328. Electron Configuration: [He], 2s^2, 2p^1
  329. Electron(s) per Shell: 2,3
  330. Valence Electron(s): 3
  331. ]]
  332. end
  333.  
  334. function beryllium()
  335. term.clear()
  336. term.setCursorPos(1,1)
  337. print[[
  338. Atomic Name: Beryllium
  339. Atomic Symbol: Be
  340. Atomic #: 4
  341. Atomic Mass #: 9
  342. Group: 2
  343. Period: 2
  344. Element Category: Alkaline Earth Metals
  345. Block: S-Block
  346. Electron Configuration: [He], 2s^2
  347. Electron(s) per Shell: 2,2
  348. Valence Electron(s): 2
  349. ]]
  350. end
  351.  
  352. function lithium()
  353. term.clear()
  354. term.setCursorPos(1,1)
  355. print[[
  356. Atomic Name: Lithium
  357. Atomic Symbol: Li
  358. Atomic #: 3
  359. Atomic Mass #: 7
  360. Group: 1
  361. Period: 2
  362. Element Category: Alkali Metals
  363. Block: S-Block
  364. Electron Configuration: [He], 2s^1
  365. Electron(s) per Shell: 2,1
  366. Valence Electron(s): 1
  367. ]]
  368. end
  369.  
  370. function helium()
  371. term.clear()
  372. term.setCursorPos(1,1)
  373. print[[
  374. Atomic Name: Helium
  375. Atomic Symbol: He
  376. Atomic #: 2
  377. Atomic Mass #: 4
  378. Group: 18
  379. Period: 1
  380. Element Category: Noble Gasses
  381. Block: S-Block
  382. Electron Configuration: 1s^2; [He]
  383. Electron(s) per Shell: 2
  384. Valence Electron(s): 2
  385. ]]
  386. end
  387.  
  388. function hydrogen()
  389. term.clear()
  390. term.setCursorPos(1,1)
  391. print[[
  392. Atomic Name: Hydrogen
  393. Atomic Symbol: H
  394. Atomic #: 1
  395. Atomic Mass #: 1
  396. Group: 1
  397. Period: 1
  398. Element Category: Diatomic Non-Metals
  399. Block: S-Block
  400. Electron Configuration: 1s^1
  401. Electron(s) per Shell: 1
  402. Valence Electron(s): 1
  403. ]]
  404. end
  405.  
  406. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement