2020-08-03 12:04:07 +02:00
|
|
|
const { randomNumberOutput } = require('./main/randomNumber')
|
|
|
|
const convertRomanArabicNumbersOutput = require('./main/convertRomanArabicNumbers')
|
|
|
|
const convertDistanceOutput = require('./main/convertDistance')
|
|
|
|
const convertTemperatureOutput = require('./main/convertTemperature')
|
|
|
|
const armstrongNumberOutput = require('./main/armstrongNumber')
|
|
|
|
const weatherRequestOutput = require('./main/weatherRequest')
|
|
|
|
const convertCurrencyOutput = require('./main/convertCurrency')
|
|
|
|
const calculateAgeOutput = require('./main/calculateAge')
|
|
|
|
const heapAlgorithmOutput = require('./main/heapAlgorithm')
|
|
|
|
const convertEncodingOutput = require('./main/convertEncoding')
|
|
|
|
const randomQuote = require('./main/randomQuote')
|
|
|
|
const rightPriceOutput = require('./main/rightPrice')
|
|
|
|
const isPalindromeOutput = require('./main/isPalindrome')
|
|
|
|
const findLongestWordOutput = require('./main/findLongestWord')
|
|
|
|
const fibonacciOutput = require('./main/fibonacci')
|
|
|
|
const sortArrayOutput = require('./main/sortArray')
|
2020-03-17 12:02:12 +01:00
|
|
|
|
|
|
|
const functionObject = {
|
2020-08-03 12:04:07 +02:00
|
|
|
randomNumber: randomNumberOutput,
|
|
|
|
convertRomanArabicNumbers: convertRomanArabicNumbersOutput,
|
|
|
|
convertDistance: convertDistanceOutput,
|
|
|
|
convertTemperature: convertTemperatureOutput,
|
|
|
|
armstrongNumber: armstrongNumberOutput,
|
|
|
|
weatherRequest: weatherRequestOutput,
|
|
|
|
convertCurrency: convertCurrencyOutput,
|
|
|
|
calculateAge: calculateAgeOutput,
|
|
|
|
heapAlgorithm: heapAlgorithmOutput,
|
|
|
|
convertEncoding: convertEncodingOutput,
|
|
|
|
randomQuote: randomQuote,
|
|
|
|
rightPrice: rightPriceOutput,
|
|
|
|
isPalindrome: isPalindromeOutput,
|
|
|
|
findLongestWord: findLongestWordOutput,
|
|
|
|
fibonacci: fibonacciOutput,
|
|
|
|
sortArray: sortArrayOutput
|
|
|
|
}
|
2020-03-17 12:02:12 +01:00
|
|
|
|
|
|
|
// Choisi la fonction à exécuter
|
2020-08-03 12:04:07 +02:00
|
|
|
function functionToExecute (option) {
|
|
|
|
return functionObject[option]
|
2020-03-17 12:02:12 +01:00
|
|
|
}
|
|
|
|
|
2020-08-03 12:04:07 +02:00
|
|
|
module.exports = functionToExecute
|