View difference between Paste ID: J2k7cksE and fXs5cKMf
SHOW: | | - or go back to the newest paste.
1
mineral = {
2
	["Native Copper"]="Rusty looking",
3
	["Graphite"]="Black/Dirt looking",
4
	["Dolomite"]="White/crystal-like",
5
	["Calcite"]="Clear/Crystal like",
6
	["Pyrite"]="Gold looking",
7
	["Chalcopyrite"]="Gold looking",
8
	["Alabaster"]="No desc. Alabaster",
9
	["Selenite"]="Crystal glass like",
10
	["Satin spar"]="Pink shing",
11
	["Barite"]="Shiny", 
12
	["Crystalline Quartz"]="Diamond look",
13
	["Rose Quartz"]="Pinkish/Crystal look",
14
	["Chert"]="Yellow/Tan color",
15
	["Chalcedony"]="Crystal look",
16
	["Orhtoclase Feldspar"]="Pinkish",
17
	["Plagioclase Feldspar"]="Yellowish",
18
	["Biotite Mica"]="Brown/Black flaky",
19
	["Muscovite Mica"]="Shiny/Flaky",
20
	["Talc"]="Grey", ["Kaolin"]="White/Chalky",
21
	["Hornblende"]="No desc. Hornblende",
22
	["Spodumene"]="White/grey",
23
	["Tourmaline"]="Green/blue color",
24
	["Magnetite"]="No desc. Magnetite",
25
	["Hematite"]="Rusty",
26
	["Limonite"]="Dark brown",
27
	["Bauxite"]="Orange/brown color",
28
	["Fluorite"]="Sea green",
29
	["Halite"]="Crystal like plastic",
30
	["Apatite"]="Food lol."
31
}
32
 
33
34
35-
local function getRandomIndex(t)
35+
local function getRandomIndexes(t)
36
	local count = 0
37
 
38
	for i,v in pairs(t) do
39
		count = count + 1
40
	end
41
42-
	local rand = math.random(1, count)
42+
	local rand1 = math.random(count/3)
43
	local rand2 = rand1 + math.random(count/3)
44
	local rand3 = rand2 + math.random(count/3)
45
46-
		if rand == num then
46+
	local res1, res2, res3
47-
			return index
47+
48
49
	for index, _ in pairs(t) do
50
		if num == rand1 then
51
			res1 = index
52
		end
53
		if num == rand2 then
54
			res2 = index
55
		end
56-
sel = math.random(1,3)
56+
		if num == rand3 then
57-
num = 0
57+
			res3 = index
58-
numq = getRandomIndex(mineral)
58+
59-
numw = getRandomIndex(mineral)
59+
60-
nume = getRandomIndex(mineral)
60+
61-
print("The mineral description is!")
61+
62-
print(mineral[numq].." ..")
62+
	return res1, res2, res3
63-
print("")
63+
64-
print("The three ones are")
64+
65-
if sel == 1 then
65+
66-
print(numq)
66+
67-
num = "1"
67+
68-
print(numw)
68+
	sel = math.random(1,3)
69-
print(nume)
69+
	numq, numw, nume = getRandomIndexes(mineral)
70-
elseif sel == 2 then
70+
71-
print(numw)
71+
	print("The mineral description is!")
72-
num = "2"
72+
	print(mineral[numq].." ..")
73-
print(numq)
73+
	print("")
74-
print(nume)
74+
	print("The three ones are")
75-
else
75+
76-
print(numw)
76+
	if sel == 1 then
77-
num = "3"
77+
		print(numq)
78-
print(nume)
78+
		print(numw)
79-
print(numq)
79+
		print(nume)
80
	elseif sel == 2 then
81-
resp = read()
81+
		print(numw)
82-
if resp == numq or resp == num then
82+
		print(numq)
83-
print("Correct!")
83+
		print(nume)
84-
print(numq .. " (".. num ..")")
84+
	else
85-
sleep(4)
85+
		print(numw)
86-
else
86+
		print(nume)
87-
print("Wrong.. The right one is..")
87+
		print(numq)
88-
print(numq .. " (".. num ..")")
88+
89-
sleep(6)
89+
90
	print("")
91
	resp = read()
92
	if resp == numq then
93
		print("Correct!")
94
		sleep(1)
95
	else
96
		print("Wrong.. The right one is..")
97
		print(numq)
98
		sleep(1)
99
	end
100
101
	term.clear()
102
	term.setCursorPos(1,1)
103
end