-
Notifications
You must be signed in to change notification settings - Fork 31
/
shuffle.html
399 lines (359 loc) · 27.5 KB
/
shuffle.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE html>
<html>
<head>
<title>Super Shuffle Word Game</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width , initial-scale=1" >
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript">
var selectedOption = '';
var gameMusic= new Audio("sound/shuffleaud.mp3");
var startGm = new Audio("sound/gamestart.mp3");
var miss = new Audio("sound/miss.mp3");
var click = new Audio("sound/click.mp3");
var correct1 = new Audio("sound/correct1.mp3");
var correct2 = new Audio("sound/correct2.mp3");
var correct3 = new Audio("sound/correct3.mp3");
var timeover = new Audio("sound/timeover.mp3");
var secsHand = 0 , score = 0 ;
var selectedInterestArray = [];
var soccer = ["soccer","goal","kick","referee","penalty","offside","cornerkick","football","foul","dribble","freekick"] ;
var nof , tid , originalword , control ;
var politics = ["candidate","vote","senate","party","ballot box","manifesto","campaign","election","voters card","honorable","position","form"];
var education = ["Academy", "Attendance", "Blackboard", "Certificate", "Chapter", "Class", "Master" ,"Classmate","College","Correction", "Duster", "Elementary", "Examination", "Exercise", "Game","Handwriting", "Headmaster", "Headmistress", "Instrument", "Box", "Laboratory", "Language", "Leader", "Lecture", "Lesson", "Mark", "Medal", "Meeting", "Note", "Book", "Period", "Physical", "Education", "Prayer", "Hall", "Prize", "Professor", "Progress", "Report", "Promotion", "Punishment", "Ruler", "Scholar", "School", "Science", "Scout", "Section", "Seminar", "Shield", "Slate", "Social", "Squad", "Student", "Syllabus", "Teacher", "Timetable", "Tuition", "Tutor", "University"];
var medicine = ["abdominal", "abdominoplasty", "stomach", "abdominocentesis", "abdominous", "abduction", "aberrant", "abiogenesis", "acrocyanosis", "acrophobia", "acromegaly", "active", "energetic", "acute", "gastritis", "ingesting", "pyelonephritis", "bladder", "infection", "tendon", "tissue", "muscle", "bony","attachment","anesthesiology", "aneurysm", "cardiovascular", "artery", "angioplasty", "neurofibroma","fibrous", "peripheral", "angiology", "disorders", "Anodonta", "mussels", "anopia", "sightlessness", "anorexia", "appetite", "antipyretic", "anuresis", "urinate", "anuria", "aphasia", "lesion", "aplasia", "apnea", "cessation", "breathing", "apneic", "sclerosis","arthritis", "arthroplasty", "asepsis", "asymptomatic", "atherosclerotic", "atherosclerosis", "atrophy", "benign", "disposition", "manner", "biopsy", "blepharitis", "blepharospasm", "blepharism", "bradycardia", "bronchiolitis", "bronchitis", "bronchopneumonia","bronchoscope", "bronchospasm", "asthma", "carcinogenic", "carcinoma", "cardiac", "arrest", "absence", "systole", "cardiology","cardiologist", "cardiomegaly", "carditis", "cauterization", "central", "cephalalgia", "cephalic","cephalometry", "cerebrospinal", "cerebrovascular", "cerebrum", "cheilitis", "cheiloschisis", "cheilosis", "chemotherapy", "cholecystectomy", "gall", "cholecystitis", "cholecalciferol", "chondrodystrophy", "chronic", "circumduction", "climacteric", "colic", "colitis", "celiocentesis", "rectum", "conception", "corneal", "coronary", "thrombosis", "craniotomy", "craniometer","uranoplasty", "cranium", "cryptorchidism", "cyanosis", "cystoparalysis", "cystoplegia", "cystitis", "cytoplast", "defibrillation", "dehiscence", "dental", "odontalgia","dermatitis", "dermatologist" ,"dermatome", "dermatosis", "diagnosis", "diagnostician", "diaphragm", "dilation", "diplococcus", "diplopia", "disease", "distal", "dorsally"];
var biology = ["Absorption", "Achromatic", "Adaptation", "Aerobic", "Algae", "Alimentary", "Allergy", "Amoeba", "Amphibian", "Analogue", "Anatomy", "Ancestor", "Antibody", "Appendage", "Aquatic", "Arboreal", "Asexual", "Assimilation", "Atrophy", "Auditory", "Backbone", "Bacteria", "Balance", "Barrier", "Benign", "Biology", "Biome", "Bisect", "Botany", "Branch", "Breathe", "Carnivorous", "Catalyst", "Cavity", "Cell", "Chlorophyll", "Cholesterol", "Chromatic", "Chromosome", "Cilia", "Classification", "Cohesive", "Collagen", "Communicable", "Community", "Contraction", "Control", "Convolution", "Coronary", "Cyclic", "Darwin", "Deciduous", "Decomposition", "Dermis", "Develop", "Dichotomous", "Dietary", "Differentiation", "Diffusion", "Digestion", "Dinosaur", "Discipline", "Displacement", "Division", "Dominant", "Dormant", "Ecology", "Ecosystem", "Ectoplasm", "Edema", "Embryo", "Endangered", "Endemic", "Endoskeleton", "Endothermic", "Energy", "Environment", "Enzyme", "Epidermis", "Erosion", "Essential", "Estrogen", "Evolution", "Exoskeleton", "Exothermic", "Extermination", "Extinct", "Factor", "Feedback", "Fertilization", "Fetus", "Fibrillation", "Filament", "Fish", "Fission", "Flower", "Food", "Fossil", "Gamete", "Gaseous", "Gastrin", "Genetics", "Genome", "Genus", "Germ", "Gestation", "Gills", "Grafting", "Greenhouse", "Absorption", "Achromatic", "Adaptation", "Aerobic", "Algae", "Alimentary", "Allergy", "Amoeba", "Amphibian", "Analogue", "Anatomy", "Ancestor", "Antibody", "Appendage", "Aquatic", "Arboreal", "Asexual", "Assimilation", "Atrophy", "Backbone", "Bacteria", "Balance", "Barrier", "Benign", "Biology", "Biome", "Bisect", "Botany", "Branch", "Breathe", "Carnivorous", "Catalyst", "Cavity", "Cell", "Chlorophyll", "Cholesterol", "Chromatic", "Chromosome", "Cilia", "Classification", "Cohesive", "Collagen", "Communicable", "Community", "Contraction", "Control", "Convolution", "Coronary", "Cyclic", "Darwin", "Deciduous", "Decomposition", "Dermis", "Develop", "Dichotomous", "Dietary", "Differentiation", "Diffusion", "Digestion", "Dinosaur", "Discipline", "Displacement", "Division", "Dominant", "Dormant", "Ecology", "Ecosystem", "Ectoplasm", "Edema", "Embryo", "Endangered", "Endemic", "Endoskeleton", "Endothermic", "Energy", "Environment", "Enzyme", "Epidermis", "Erosion", "Essential", "Estrogen", "Evolution", "Exoskeleton", "Exothermic", "Extermination", "Extinct", "Factor", "Feedback", "Fertilization", "Fetus", "Fibrillation", "Filament", "Fish", "Fission", "Flower", "Food", "Fossil", "Gamete", "Gaseous", "Gastrin", "Genetics", "Genome", "Genus", "Germ", "Gestation", "Gills", "Grafting", "Greenhouse"];
var chemistry = ["Abiosis", "Acid", "Acidic", "Affect", "Alchemist", "Alkaline", "Allotrope", "Alteration", "Amphoteric", "Analysis", "Anomaly", "Antigen", "Apparatus", "Application", "Arrangement", "Astatine", "Atomic", "Atomic number", "Atrophy", "Azeotropic","Balance", "Base","Benzene", "Bonding", "Bromine", "Burning","Carbon", "Carcinogen", "Catalyst", "Cell", "Centigrade", "Chain", "Change", "Chemical bond", "Chlorine", "Colloid", "Combination", "Composition", "Compound", "Concentration", "Conclusion", "Consumption", "Crystal", "Current", "Data", "Decomposition", "Desalination", "Desiccant", "Determination", "Detritus", "Discovery", "Display", "Distillation", "Dopant", "Dynamics","Efflorescence", "Electrical", "Electrolysis", "Electron", "Elements", "Enzyme", "Equilibrium", "Ester", "Examination","Ferment", "Fission", "Fluid", "Fluorine", "Formula", "Fractionation", "Fuel", "cells","Gas","Halogen", "Heat", "Helium", "Hydrocarbon", "Hydrogen", "Hydrolysis", "Hydroxide", "Hypothesis","Impurity", "Inactive", "Inert", "Inhibitor", "Inorganic", "Inquiry", "Instruction", "Interaction", "Interactive", "Investigation", "Iodine", "Ion", "Ions", "Isomer", "Isotope","Kinetics","Laser", "Latent heat", "Light", "Lipid", "Liquid", "Litmus paper","Magnetic", "Matter", "Measure", "Melt", "Metals", "Microbe", "Mixture", "Molecule","Negative charge", "Neon", "Neutralize", "Neutrons", "Non-carbon", "Non-living", "Nonmetallic", "Nuclear", "Nucleus", "Number","Orbit", "Organic", "Osmosis", "Oxidation", "Oxygen","Particle", "Periodic table", "Pharmacology", "Phenomena", "Physical", "Pipette", "Pollution", "Polymer", "Positive Power", "Practical", "Process", "Properties", "Protein", "Protons", "Pure","Quantum", "Theory", "Quark","Radiation", "Radical", "Radioactivity", "Reaction", "Reagent", "Rectify", "Reduction", "Refine", "Release", "Revelation", "Revert","Salt", "Scientist", "Semiconductor", "Separation", "Soluble", "Solvent", "Speed", "Substance", "Suspension", "Symbiosis", "Symbol", "Syneresis", "Synergy", "Synthesis", "Synthesize", "Systematic","Table", "Temperature", "Titration", "Toxin", "Transformation", "Transition","Undissolved", "Unit", "Unreactive", "Uranium","Valency", "Validation", "Values", "Vapor", "Vary", "Versatile", "Viscosity","Wave particle", "Weight","Xenon","Zinc", "Zirconium", "Zymoscope"];
var physics = ["Absolute zero", "Acceleration", "Accuracy", "Acoustics", "Action", "Adhesion", "Affect", "Amplitude", "Angular", "Antiproton", "Apparent", "Applied", "Apply", "Aptitude", "Aristotle", "Aspect", "Atmosphere", "Atom", "Atomic", "Attenuate", "Attraction", "Aviation", "Axis", "Balance", "Basic", "Bodies", "Boson", "Branch","Calculus", "Capacity", "Centrifugal", "Changes", "Chaos", "Charge", "Chemical", "Chromatics", "Circular", "Collide", "Component", "Compression", "Condensation", "Conductivity", "Conservation", "Constant", "Control", "Conversion", "Copernicus", "Cosmology", "Curie", "Damping", "Decibel", "Density", "Dependence", "Deposits", "Design", "Development", "Deviation", "Diode", "Direction", "Discipline", "Displacement", "Distance", "Distortion", "Disturbance", "Doctorate", "Drag", "Dynamics", "Effect", "Einstein", "Elasticity", "Electricity", "Electromagnetic", "Electron", "Electronics", "Emission", "Energy", "Engine", "Engineer", "Entropy", "Equation", "Equilibrium", "Equivalent", "Evaporation", "Expansion", "Experiment", "Explosion", "External", "Factor", "Fission", "Flight", "Flow", "Fluid", "Flying", "Focus", "Force", "Form", "Formula", "Frequency", "Friction", "Fulcrum", "Fundamental force", "Galileo", "Gas", "Generate", "Geophysics", "Gilbert", "Graph", "Gravitation", "Gravity", "Guide", "Gyroscope", "Half-life", "Harness", "Heat", "Hertz", "Hold", "Hydraulics", "Identical", "Impact", "Impulse", "Incandescent", "Inertia", "Influence", "Innovate", "Inquiry", "Interaction", "Intervening", "Invention", "Inverse", "Investigation", "Invisible", "Irradiate", "Isotope", "Joule", "Kaon", "Kinetics", "Laser", "Laws", "Level", "Lift", "Light", "Liquids", "Loft", "Lumen", "Machinery", "Magnet", "Magnetism", "Magnitude", "Mass", "Mathematics", "Matter", "Measure", "Mechanics", "Meteorology", "Metrics", "Modulate", "Molecule", "Motion", "Movement", "Navigation", "Negative", "Newton", "Nuclear", "Nucleus", "Objects", "Optics", "Oscillation", "Overload", "Parallax", "Parity", "Particle", "Performance", "Phenomenon", "Photon", "Piston", "Pitch", "Plasma", "Position", "Prediction", "Pressure", "Principal", "Projectile", "Propagation", "Properties", "Proportion", "Psi", "Pulse", "Quality", "Quandary", "Quanta", "Quantitative", "Quantity", "Quantum", "jump", "leap", "Quark", "Radiation", "Radioactivity", "Reception", "Relationship", "Relative", "Relativity", "Repulsion", "Research", "Resistance", "Resolution", "Resonance", "Rest", "Reversal", "Robotic", "Rotation", "Saturation", "Scalar", "Science", "Scientific", "Seismology", "Semiconductor", "Shape", "Shift", "Sir Issac", "Solid", "Sonic", "Sound", "Space", "Spectrum", "Speed", "Standing", "Stationary", "Statistics", "Strain", "Stress", "Structure", "Study", "Sublimation", "Substance", "Surface", "Suspension", "Symmetry", "System", "Temperature", "Tensile", "Tension", "Theoretical", "Theory", "Thermal", "Thermodynamics", "Thrust", "Torque", "Training", "Trajectory", "Transformation", "Transistor", "Transition", "Trough", "Turning", "Ultrasonic", "Uncertainty", "Uniform", "Unify", "Unique", "Unit", "Universal", "University", "Vacuum", "Value", "Vapor", "Variable", "Variation", "Vector", "Velocity", "Viscosity", "Volatile", "Voltage", "Volume", "Wave", "Weight", "White noise", "X-ray", "Zone"];
var geography = ["Abrasion", "Abundance", "Acre", "Adaptation", "Aeration", "Agriculture", "Alluvial", "Altitude", "Annual", "Anthropology", "Arable", "Archeology", "Archipelago", "Arid", "Atlas", "Atmosphere", "Atoll", "Australia", "Axis", "Azimuth", "Badlands", "Barren", "Barrier", "reef", "Basin", "Bayou", "Belt", "Belvedere", "Berm", "Bluff", "Bog", "Border", "Boundary", "Bowl", "Butte","Caldera", "Canal", "Canyon", "Cape", "Cardinal points", "Cartographer", "Cartography", "Cascade", "Cavern", "Cay", "Celestial", "Change", "Channel", "Chaparral", "Chasm", "Circulation", "Circumnavigate", "Civilization", "Classification", "Cliff", "Climate", "Clippings", "Cluster", "Coast", "Community", "Compass", "Compost", "Condensation", "Conditions", "Coniferous", "Conservation", "Continent", "Continental divide", "Contour", "Coordinate", "Copse", "Crag", "Crater", "Creek", "Crevasse", "Crevice", "Cuesta", "Cultivate", "Current", "Cuttings", "Cycles", "Dam", "Damage", "Deciduous", "Decomposition", "Decoration", "Decorative", "Dedication", "Degree", "Delicate", "Delta", "Depth", "Desert", "Destruction", "Develop", "Digging", "Disperse", "Distance", "Diversity", "Division", "Doldrums", "Domain", "Drainage", "Drought", "Dune", "Earth", "Earthquake", "Ecology", "Eddy", "Elements", "Elevation", "Eluvial", "Energy", "Environment", "Equator", "Equidistant", "Eradicate", "Erosion", "Escarpment", "Esker", "Espalier", "Estuary", "Eurasia", "Europe", "Evaporation", "Everglade", "Evidence", "Evolve", "Exfoliate", "Expanse", "Exposure", "Farming", "Fault", "Feature", "Fissure", "Fjord", "Flood plain", "Forest", "Fossil", "Frost", "Fuel", "Gap", "Geyser", "Glacier", "Glade", "Glen", "Globe", "Gorge", "Grasslands", "Great Divide", "Greenland", "Greenwich", "Grid", "Grotto", "Grove", "Gulch", "Gulf", "Gully", "Guyot", "Habitat", "Harbor", "Hardy", "Harvest", "Headland", "Hedge", "Height", "Heirloom", "Heliotrope", "Hemisphere", "Highlands", "Hinterlands", "Horizon", "Iceberg", "Igneous rock", "Inlet", "Interconnection", "International Date Line", "Inundate", "Involve", "Irrigation", "Island", "Isobar", "Isotherm", "Isthmus", "Jet stream", "Jungle", "Key", "Kill", "Knoll", "Lagoon", "Land", "Land form", "Landmark", "Landscape", "Latitude", "Lava", "Legend", "Levee", "Littoral", "Location", "Longitude", "Lowlands", "Magnetic", "Mainland", "Map", "Marine", "Marsh", "Mass", "Massif", "Materials", "Meadow", "Meander", "Mercator projection", "Meridian", "Mesa", "Minute", "Moisture", "Monsoon", "Moor", "Morass", "Mountain", "Mulch", "Nadir", "Nation", "Natural", "North America", "Pole", "Northern Noticeable", "Oasis", "Ocean", "Oceania", "Ooze", "Original", "Overlook", "Ozone", "Palisade", "Pampas", "Parallel", "Pelagic", "Peninsula", "Permafrost", "Permeable", "Physical", "Piedmont", "Pinnacle", "Plains", "Plateau", "Polar", "Polder", "Pollutant", "Population", "Position", "Prairie", "Prime meridian", "Promontory", "Proof", "Province", "Quality", "Quantity", "Quest", "Questions", "Rain forest", "Rainfall", "Range", "Reef", "Region", "Scale", "Sea level", "Sediment", "Seismograph", "Site", "Situation", "Smog", "Society", "Steppe", "Strait", "Subtropical", "Swamp", "Tectonics", "Temperatures", "Territory", "Threat", "Tidal wave", "Topography", "Transportation", "Tributary", "Tropic", "Tundra", "Typhoon", "Unexpected", "Unique", "Universal", "Unusual", "Urban", "Value", "Variation", "Variety", "Various", "Vegetation", "Verdant", "Volcano", "Weather", "Weeds", "Wetlands", "Widespread", "Wilt", "Wither", "Woodlands", "Xeriscape", "Xylem", "Xyst", "Yard", "Yellow jacket", "Zone", "Zygophyte"];
var law = ["contract","consideration","negligence","precedent","infringement","perjury","statute","sue","challenge","void","lewd","detention","parole","misdemeanour","injunction","summons", "writ", "frustration", "bar", "bench", "trespass", "interrogation", "apprehend","magistrate", "marshal", "embezzlement", "malpractice", "fugitive", "torture", "acquitted", "affidavit", "barrister", "solicitor", "chancellor", "equity", "piracy", "grill", "class", "action", "common-law", "marriage", "canon", "law", "boarding", "jurisprudence", "libel", "curfew", "espionage", "treason", "abduction", "autopsy", "impeachment", "collective", "bargaining", "verdict","legislation", "repudiate", "perpetrator", "offender", "culprit", "estoppel", "tenancy", "deed", "surety" ,"clause", "performance", "implied", "trust", "foreclosure", "bankruptcy", "roundup", "security", "interest", "juvenile", "delinquency", "expiration", "convict", "ordinance", "suspended", "sentence", "discovery", "felony", "adjudicate", "arraign", "bail", "assault", "dissent", "non", "compos", "mentis", "fiat", "evict", "aggravated", "refutation", "force", "majeure", "complaint"];
var economics = ["Asset", "Turnover","Ratio","Bailout","Balance Of Payment","Bank Rate", "Base", "Brexit", "Broad","Money To Reserve","Call","Capacity", "Cost", "Capital","Account","Adequacy", "Market", "Casa", "Catch Up Effect", "Ceteris Paribus", "Clearing", "Price", "Consumer", "Index", "Contagion", "Contractionary", "Policy", "Core","Inflation","Benefit","Analysis","Push", "Countervailing","Duties","Credit","Default", "Swaps","Cross","Elasticity","Demand", "Crowding","Out","Currency", "Deposit", "Deadweight", "Loss", "Debt", "Equity","Deflation","Depreciation","Depression", "Dividend","Signaling","Domestic", "Institutional","Investo","Due Date", "Ease", "Doing", "Business","Exchange","Fair Trade","Fallout","Risk","Gross","Saving", "National Product","Human","Imperfect Competition","Indifference","Curve","Inferior","Goods", "Infrastructure","Investment","Banking", "Invisible","Hand","Labour","Law","Supply","Libor","Liquid","Asset","Liquidity","Trap","Macroeconomics","Marginal","Standing","Facility","Capitalization", "Mark","Mibor","Microeconomics","Monetary","Monopoly","Moral","Hazard","Efficiency", "Payments","Banks Percentage","Point", "Perfect","Phillips","Poverty","Preferences","Ceiling", "Floor","Mechanism","Principle", "Agent","Problem","Privatization","Producer","Production","Gap","Possibility","Profitability","Property","Tax","Proportional","Public","Distribution", "System","Purchasing","Power","Parity","Quantitative","Quantity","Demanded","Supplied","Theory","Rational","Behaviour","Rationing","Cycle","Economic","Growth"]
function countDown()
{
nof = 3 ; //this determines the number of minutes in our application
engine() ;
}
function stopCountDown()
{
document.getElementById("control2").disabled = true ;
document.getElementById("control").value = "Begin" ;
nof = "" ;
secsHand = 0 ;
}
function engine()
{
secsHand-- ;
if(secsHand == -1)
{
secsHand = 59 ;
nof-- ;
if(nof == -1)
{
nof = 0 ;
secsHand = 0 ;
document.getElementById('displayTime').value = 0 + " : " + 0 ;
control = false ;
timeover.play();
// alert("Your time is totally over and over and over, Game over") ;
// return ;
startOver();
}
}
document.getElementById('displayTime').value = nof + " : " + secsHand ;
tid = window.setTimeout("engine()",1000) ;
}
function shuffle(word)
{
originalword = word ;
var wordArray = word.split("");
var wordLength = word.length ;
var shuffledWord = "" ;
for (var i = 0; i < wordLength ; i++)
{
var rand = Math.floor(Math.random() * wordLength) ;
//rand = 3
//alert(rand + " " + i + " " + wordArray[rand]) ;
if(wordArray[rand] != "")
{
shuffledWord += wordArray[rand] ;
wordArray[rand] = "" ;
}
else
{
i-- ;
}
}
document.getElementById("oword").value = shuffledWord ;
}
function begin()
{
//with the assumption math.random returns 5
index = Math.floor(Math.random() * selectedInterestArray.length) ;
shuffle(selectedInterestArray[index]) ;
countDown() ;
startGm.play();
click.play();
}
function computeAns()
{
click.play();
var x="";
var ans = document.getElementById("sword").value ;
if(ans == originalword)
{
correct1.play();
score+=10;
switch(score)
{
case 10:
var b = "<div class='progress' style=width:100%'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='10' style='width:10px'>10% complete";
b+= "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 20:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-danger' role='progress-bar' aria-valuenow='20' style='width:20px'>20% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 30:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='30' style='width:30px'>30% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 40:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='40' style='width:40px'>40% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 50:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='50' style='width:50px'>50% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 60:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='60' style='width:60px'> 60% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 70:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='70' style='width:70px'>70% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 80:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='80' style='width:80px'> 80% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 90:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='90' style='width:90px'> 90% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
case 100:
var b = "<div class='progress'>";
b += "<div class='progress-bar progress-bar-info' role='progress-bar' aria-valuenow='100' style='width:100px'>100% complete";
b += "<div>" ;
b += "</div>" ;
//alert(a) ;
document.getElementById("check").innerHTML = b;
break;
}
}
else
{
miss.play();
alert("Wrong Answer, the correct answer is " + originalword ) ;
}
document.getElementById("sword").value = "" ;
if(selectedInterestArray.length == 0)
{
control = false ;
if (score>=50)
{
correct3.play(); alert("Your score is "+score);
startOver();
}
else
{
alert("Your score is "+score); timeover.play();
// alert("The game is over") ;
// return ;
startOver();
}
}
index = Math.floor(Math.random() * selectedInterestArray.length) ;
shuffle(selectedInterestArray[index]) ;
selectedInterestArray.splice(index,1) ;
sword.focus();
}
function startOver() {
click.play();
location.reload();
}
function disp()
{
var d=$("#v").val();
var selectedOption = f1.interest.value;
if(selectedOption == 'soccer')
{
selectedInterestArray = soccer;
}
else if(selectedOption == 'politics')
{
selectedInterestArray = politics;
}
else if(selectedOption == 'education')
{
selectedInterestArray = education;
}
else if(selectedOption == 'medicine')
{
selectedInterestArray = medicine;
}
else if(selectedOption == 'biology')
{
selectedInterestArray = biology;
}
else if(selectedOption == 'chemistry')
{
selectedInterestArray = chemistry;
}
else if(selectedOption == 'physics')
{
selectedInterestArray = physics;
}
else if(selectedOption == 'geography')
{
selectedInterestArray = geography;
}
else if(selectedOption == 'law')
{
selectedInterestArray = law;
}
else if(selectedOption == 'economics')
{
selectedInterestArray = economics;
}
if(d!="")
{
$("#ro").slideToggle();
$("#col").hide();
$("strong").html(d);
begin();
sword.focus();
}
else{
alert("Enter your name first");}
click.play();
}
</script>
<style type="text/css">
div#background {
width: 100%;
height: 800px;
background-image: url("shuffle2.png");
background-repeat: no-repeat;
background-size: cover;
background-position: right bottom, left top;
}
</style>
</head>
<body onload="gameMusic.play()">
<div id="background">
<div class="container">
<div class="row" style="display:none" id="ro">
<div class="col-md-4">
<div >
<div align="center">
<h1>Shuffle Word</h1>
</div>
<div class="panel-body">
<div class="form-group">
<div class="form-group">
<strong style="color:"></strong><br>
<!-- <input type="button" id="control" class="btn btn-primary" value="START" onclick="begin()" name="">-->
</div>
<div class="form-group">
<input type="text" class="form-control" name="" id="oword" placeholder="shuffled word here">
</div>
<div class="form-group">
<input type="text" class="form-control" name="" id="sword" placeholder="answer here">
</div>
</div>
<div class="form-group">
<input type="button" id="control" class="btn btn-danger" value="Submit" onclick="computeAns()" name="">
<input type="button" id="control" class="btn btn-warning" value="Start Over" onclick="startOver()" name="">
<!-- start again button added by Pressemman -->
</div>
</div>
<div>
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="form-group">
<input type="text" readonly id="displayTime" class="form-control" name="">
</div>
<div id="check">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<form name="f1" action="#" onSubmit="javasript: return false">
<div class="col-md-6" id="col">
<br><br><br>
Select an area of interest:
<input type="radio" name="interest" value="soccer" id="interest" checked />Soccer
<input type="radio" name="interest" id="interest" value="politics">Politics
<input type="radio" name="interest" value="education" />Education
<input type="radio" name="interest" value="physics" />Physics
<input type="radio" name="interest" value="medicine" />Medicine
<input type="radio" name="interest" value="biology">Biology
<input type="radio" name="interest" value="chemistry">Chemistry
<input type="radio" name="interest" value="geography">Geography
<input type="radio" name="interest" value="law">Law
<input type="radio" name="interest" value="economics">Economics
<br>
<input type="text" name="" placeholder="enter you name here first" id="v" class="form-control"><br>
<button onclick="disp()" class="btn btn-primary">Submit</button>
</div>
</form>
<audio autoplay>
<source src="sound/shuffleaud.mp3" type="audio/mp3">
</audio>
</div>
</div><div></div>
</div>
</body>
</html>