Skip to content

MDShields7/sumo-rank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sumo Rank Banner

Documentation - How to use sumoRank

Contents

Quick Brief on Sumo Ranks
Rank Input
Format Input
Common Usage Examples
Use Guide
Format Input Rules
Rank Input Rules
Content Errors
Input Errors for Rank
Input Errors for Format

QUICK BRIEF ON SUMO RANKS

Each rank has a name, number and direction - typically in that order.
Example 1: The highest rank in sumo
Long, all caps version: "Yokozuna 1 East"
Short, partial caps version: "Y1e"
Example 2: The lowest possible rank in the top division
Long, all caps version: "Maegashira 17 West"
Short, partial caps version: "M17w"

Sumo Rankings Pyramid

RANK INPUT

Named ranks (high to low):
Yokozuna, Ozeki, Sekiwake, Komusubi, Maegashira, Juryo, Makushita, Sandanme, Jonidan, Jonokuchi
Number ranks (high to low):
1 - 100+ (100 is a typical maximum, but it is unlimited in some cases)
Direction ranks (high to low):
East, West

FORMAT INPUT

Nn nn N n
Yokozuna yokozuna Y y
Ozeki ozeki O o
Sekiwake sekiwake S s
Komusubi komusubi K k
Maegashira maegashira M m
Juryo juryo J j
Makushita makushita Ms ms
Sandanme sandanme Sd sd
Jonidan jonidan Jd jd
Jonkuchi jonokuchi Jk jk
Rank Number Ranges #
Yokozuna 1 - 2
Ozeki 1 - 2
Sekiwake 1 - 2
Komusubi 1 - 2
Maegashira 1 - 17(limit)
Juryo 1 - 14(limit)
Makushita 1 - 60(limit)
Sandanme 1 - 100(limit)
Jonidan 1 - 100+
Jonkuchi 1 - 60+
Dd dd D d
East east E e
West west W w

COMMON USAGE EXAMPLES

Nn # Dd --> Yokozuna 1 East, Maegashira 12 West, Jonokuchi 68 East
nn # dd --> yokozuna 1 east, maegashira 12 west, jonokuchi 68 east
N#D --> Y1E, M12W, Jk68E
N#d --> Y1e, M12w, Jk68e
N --> Y, M, Jk
#d --> 1e, 12w, 68e

USE GUIDE

sumoRank.format("<RANK>", "<DESIRED FORMAT>")

FORMAT INPUT RULES

  1. Format can be arranged in any combination
    sumoRank.format("S1W", "Nn") --> "Sekiwake"
    sumoRank.format("S1W", "N#d") --> "S1w"
  2. Spaces between rankings will be retained
    sumoRank.format("S1W", "nn # dd") --> "sekiwake 1 west"

RANK INPUT RULES

  1. Input rank can be any arrangement
    sumoRank.format("Komusubi 1 e", "N#D") --> "K1E"
    sumoRank.format("e 1 Komusubi", "N#D") --> "K1E"
    sumoRank.format("K1e", "N#D") --> "K1E"
  2. Input rank IS caps sensitive
    sumoRank.format("KomuSUBi 1 eASt", "Nn") --> Error SR.304

CONTENT ERRORS

  • SR.101 Non-existent Name/Number rankings throw error
    sumoRank.format("Maegashira 18 East", "N#D") --> Error
  • SR.202 (INCOMPLETE) Lower division rankings throw error
    sumoRank.format("Sandanme 82 East", "N#D") --> Error

RANK INPUT ERRORS

  • SR.301 Empty rank types throw error
    sumoRank.format("", "Dd") --> Error
  • SR.302 Blank rank types throw error
    sumoRank.format(" ", "Nn#Dd") --> Error
  • SR.303 (Placeholder Error)
  • SR.304 Non-rank item throw error
    sumoRank.format("M two east", "N#D") --> Error
    sumoRank.format("i like turtles", "N#D") --> Error
  • SR.305 Multiple instances of rank type throw error
    sumoRank.format("Y Y", "Nn#Dd) --> Error
    sumoRank.format("Y y", "Nn#Dd) --> Error
    sumoRank.format("Y M", "Nn#Dd) --> Error
    sumoRank.format("Ozeki ozeki", "Nn#Dd) --> Error
    sumoRank.format("Ozeki Sekiwake", "Nn#Dd) --> Error
  • SR.306 Rank Name not given, but requested
    sumoRank.format("2 West", "Nn") --> Error
  • SR.307 Rank Number not given, but requested
    sumoRank.format("Ozeki West", "#") --> Error
  • SR.308 Rank Direction not given, but requested
    sumoRank.format("Ozeki 2", "Dd") --> Error

FORMAT INPUT ERRORS

  • SR.401 Empty format types throw error
    sumoRank.format("K2E", "") --> Error
  • SR.402 Blank format types throw error
    sumoRank.format("K2E", " ") --> Error
  • SR.403 Incorrect format types throw error
    sumoRank.format("Y1E",123) --> Error
    sumoRank.format("Y1E",true) --> Error
    sumoRank.format("Y1E",[]) --> Error
    sumoRank.format("Y1E",{}) --> Error
  • SR.404 (Placeholder Error)
  • SR.405 (Placeholder Error)
  • SR.406 Duplicate rank format type
    sumoRank.format("M5W", "N n") --> Error
  • SR.407 Duplicate number format type
    sumoRank.format("M5W", "# #") --> Error
  • SR.408 Duplicate direction format type
    sumoRank.format("M5W", "Dd dd") --> Error

sumoRank.sort( [ {}, {}, {}, etc ] )

FORMAT INPUT RULES

  1. Format must be an array of objects with 'rank' property
  2. The 'rank' property must be in the 'N#D' format
    [ {rank:"Y1E"}, {rank:"M12W"} ]
    sumoRank.format([ {rank:"Sd1W"}, {rank:"M2E"} ])
    --> [ {rank:"M2E"}, {rank:"Sd1W"} ]
    sumoRank.format([ {rank:"K1E"}, {rank:"O1W"} ])
    --> [ {rank:"O1E"}, {rank:"K1E"} ]

INPUT ERRORS

  • SR.501 Empty array, or array with only 1 rank throw error
    sumoRank.sort([]) --> Error
    sumoRank.sort([ {id:1,rank:"Y1E"} ]) --> Error
  • SR.502 Array items do not contain 'rank' property
    sumoRank.sort([ {id:1}, {id:2} ]) --> Error
  • SR.503 Cannot sort, items do not contain rank number
    sumoRank.sort([ {rank:"Y"}, {rank:"Y"} ]) --> Error
  • SR.504 Cannot sort, items do not contain rank direction
    sumoRank.sort([ {rank:"Y1"}, {rank:"Y1"} ]) --> Error
  • SR.505 Duplicate rank found
    sumoRank.sort([ {rank:"Y1E"}, {rank:"Y1E"} ]) --> Error

About

Tools for sumo wrestling ranks: format and sort

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published