OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Writing an ordering algroithm in Javascript [closed]

  • Thread starter Thread starter guybrush 20X6
  • Start date Start date
G

guybrush 20X6

Guest
I'm putting a questionaire together have 4 different scores being held, let's call them W, X, Y and Z so my values at the end of a runthrough may look something like this:

Code:
'int W = 5; int X = 3; int Y = 2; int Z = 2;'

What I need to do is find a way to store the values, arrange them by order and then pick out the highest one so the final output is "you have got the W ending".

Most methods I've looked up only arrange the values of the variables and lose track of which variable was attached to that score and attempts to solve it with only if statements quickly got unweildy. I may be using the wrong terminology when looking for what methods to use so any guidance is appreciated.

<p>I'm putting a questionaire together have 4 different scores being held, let's call them W, X, Y and Z so my values at the end of a runthrough may look something like this:</p>
<pre><code>'int W = 5; int X = 3; int Y = 2; int Z = 2;'
</code></pre>
<p>What I need to do is find a way to store the values, arrange them by order and then pick out the highest one so the final output is "you have got the W ending".</p>
<p>Most methods I've looked up only arrange the values of the variables and lose track of which variable was attached to that score and attempts to solve it with only if statements quickly got unweildy. I may be using the wrong terminology when looking for what methods to use so any guidance is appreciated.</p>
 

Latest posts

ن
Replies
0
Views
1
نعمان منذر محمود الجميلي
ن
Top