Skip to content
Snippets Groups Projects
Commit 9830075d authored by Fernando Erd's avatar Fernando Erd
Browse files

add Arrangement

parent 6ed17982
No related branches found
No related tags found
1 merge request!254WIP: v1.13.0
Pipeline #23034 failed
/*
Copyright (C) 2016 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
const names = ["CRE", "PRE", "EF-AI", "EF-AF", "MULTIETAPA", "EM", "EJA", "PROF", "EE"]
module.exports = function arrangement(id) {
let binaryId = id.toString(2)
let str = ''
for (let i = 0; i <= binaryId.length; i++) {
if (binaryId.charAt(i) === "1") {
str += names[ i + (names.length - binaryId.length) ] + '/';
}
}
return str.slice(0, -1);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment