Mountain Project Logo

Crux Calculator

Original Post
Max Lasky · · Crested Butte, CO · Joined Oct 2011 · Points: 75

Mountain Project Community,

I recently deployed a super simple javascript app that converts climbing grades. I very recently wrote the code and know there are a couple bugs but I think it is a neat little tool. Please let me know what you guys (and girls) think.

www.cruxcalculator.com

-Max

Larry · · SoAZ · Joined Jan 2006 · Points: 50

It seems to choke on R and X (extensions to YDS).

And + and -.

Max Lasky · · Crested Butte, CO · Joined Oct 2011 · Points: 75

thanks for the feedback Larry...It doesnt currently take into account protection quality rating but I should definitely add that!

Ted Angus · · Unknown Hometown · Joined Aug 2012 · Points: 25

make it so it takes both lower case and capital 'v' grades ie 'v4' and 'V4'.

Long Ranger · · Boulder, CO · Joined Jan 2014 · Points: 619

So, I select, "YDS", entered in, "5.12", and click the, "Submit" button, and the modal window appeared, but no grades at all were shown, just the labels for the grade.

This is FireFox 41.0.1 for the Mac.

The console prints the following:

4 main.js:213:2
yds main.js:214:2

Long Ranger · · Boulder, CO · Joined Jan 2014 · Points: 619

Yeah, the problem is with your lookup table. You don't actually parse the grade, you just look up what someone puts in. So, there's just no entry for, "5.12", but there is one for, "5.12a". The quick fix is to add it,

var s_fix = new GlobalGradeCreator ("5.12","","E5","7a+","VIII+","IXc","25","26","7+","8-","8a","v4","B5-6","6b/c")

(after line 189, or so)

That should add it to your array, you iterate over, as your pushing it onto the stack ($scope.globalArray). That's not a *good* fix, as it only solves this one case.

So, some suggestions:

Instead having people input the grade, have a way to select the grading system, then the grade. People are going to screw up putting it in, anyways, and the grades that are valid is a fairly finite list - Just have a list of the grades available for each grade type, and then also use that list to validate it's good input.

Look forward to seeing what you can do with this!

Russ Keane · · Salt Lake · Joined Feb 2013 · Points: 392

This is the perfect thread for a comment by ZAKS SEBASTIAN .... Where are you

Anonymous · · Unknown Hometown · Joined unknown · Points: 0

Probably don't want to make it case sensitive and also when you put in invalid text you should probably validate and give an error message instead of poping up the last sucessful input.

Also probably want to add +/- to ones that translate into a range. So that if 3 grades translate to a V5 than the lower ones go to V5- the middle one goes to V5 and the upper one goes to V5+ etc.

Guideline #1: Don't be a jerk.

General Climbing
Post a Reply to "Crux Calculator"

Log In to Reply

Join the Community

Create your FREE account today!
Already have an account? Login to close this notice.

Get Started.