This module just reverses a number for example:
2008 -> 8002
24 -> 42
123456789 -> 987654321
| #!/bin/sh | |
| # Configure your device with tracked dotfiles | |
| # check if git is installed | |
| if ! command -v git >/dev/null 2>/dev/null; then | |
| echo "git command not found" | |
| echo "$0 depends on git" | |
| exit 1 | |
| fi |
| pub fn div(mut lhs: u32, mut rhs: u32) -> u32 { | |
| // align the most significant bits | |
| let misalign = if let Some(n) = rhs.leading_zeros().checked_sub(lhs.leading_zeros()) { | |
| n | |
| } else { | |
| return 0; | |
| }; | |
| rhs <<= misalign; | |
| let mut quotient = 0; |
| isPalindrome :: (Eq a) => [a] -> Bool | |
| isPalindrome xs = xs == reverse xs | |
| isNotPalindrome :: (Eq a) => [a] -> Bool | |
| isNotPalindrome xs = xs /= reverse xs | |
| fmt n | |
| | n < 10 = "0" ++ show n | |
| | otherwise = show n |
| area :: (Integral a, Floating b) => a -> a -> a -> b | |
| area a b c = (sqrt . fromIntegral) $ s * (s - a) * (s - b) * (s - c) | |
| where s = (a + b + c) `div` 2 |
| integer function referenceAngle(n) | |
| implicit none | |
| integer, intent(in) :: n | |
| integer :: rem | |
| rem = mod(n, 360) | |
| if (rem < 0) then | |
| stop 1 |
| fibs = 1 : 1 : zipWith (+) fibs (tail fibs) |
| generateRandNum = (min, max) => { | |
| let randomNumber = Math.round((max - min) * Math.random() + min); | |
| return randomNumber; | |
| } | |
| testConnection = () => { | |
| console.log("Connection confirmed: RandNum") | |
| } | |
| write = function = (text) => { | |
| $("#result").text(text); | |
| console.log("\"" + text + "\" " + "was written on the page"); | |
| } | |
| testConnection = () => { | |
| console.log("Connection confirmed: Write") | |
| } | |
| export {write, testConnection} |
| let keyOffset = KeyOffset(key); // calls an external function | |
| let noteNumber = convertNoteToNumber(note); // calls an external function | |
| for (var i = 0; i < keyOffset; i++) { | |
| if (noteNumber > 10) { | |
| noteNumber = 0; | |
| } else { | |
| noteNumber += 1; | |
| } | |
| } | |
| newNote = convertNumberToNote(noteNumber); // calls an external function |