This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function statusBar(start){ | |
| let totalElapsed = calculateTimeElapsed(start); | |
| const { hours, mins, secs } = formatTimeForLogging(totalElapsed); | |
| myStatusBar.text = `${hours}:${mins}:${secs}`; | |
| myStatusBar.show(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| testing this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| testing this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const validate = (input) => { | |
| let inputString = `${input}` | |
| let power = parseInt(inputString.length); | |
| let total = 0; | |
| for (let i = 0; i < inputString.length; i++){ | |
| let current = parseInt(inputString[i]); | |
| total += Math.pow(current, power); | |
| } | |
| if (input == total){ | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const translate = (rna) => { | |
| let aminoAcids = { | |
| "AUG":"Methionine", | |
| "UUU":"Phenylalanine", | |
| "UUC":"Phenylalanine", | |
| "UUA":"Leucine", | |
| "UUG":"Leucine", | |
| "UCU":"Serine", | |
| "UCC":"Serine", | |
| "UCA":"Serine", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from "constants"; | |
| export class RotationalCipher { | |
| static rotate(stringIn, rPoint) { | |
| let alphabet = "abcdefghijklmnopqrstuvwxyz"; | |
| let translation = ""; | |
| let newString = stringIn.toLowerCase(); | |
| for (let i = 0; i < newString.length; i++){ | |
| let index = alphabet.indexOf(newString[i]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const transpose = (inputArr) => { | |
| let transposedArray = []; | |
| if (inputArr.length == 0){ | |
| return transposedArray; | |
| } | |
| //finds row max length for iterating through jagged arrays | |
| let maxRowLength = 0; | |
| let indexOfMaxRow = 0; | |
| let numberOfRows = inputArr.length; | |
| let lengthOfBottomRow = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Scale { | |
| constructor(tonic) { | |
| this.key = tonic; | |
| this._flats = new Set(["F", "Bb", "Eb", "Ab", "Db", "Gb", "d", "g", "c", "f", "bb", "eb"]); | |
| this._sharps = new Set (["G", "D", "A", "E", "B", "F#", "e", "b", "f#", "c#", "g#", "d#"]); | |
| } | |
| chromatic() { | |
| let scale = []; | |
| let flats = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Series { | |
| constructor(numString) { | |
| this._digits = numString; | |
| } | |
| get digits() { | |
| let digArr = this._digits.split("").map(Number).filter(Number.isFinite); | |
| return digArr; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class PhoneNumber { | |
| constructor(numString) { | |
| this._phoneNum = numString; | |
| } | |
| number() { | |
| let phoneNum = this._phoneNum.match(/([0-9])/g); | |
| let numArr = phoneNum; | |
| if (numArr.length > 11 || numArr.length < 10){ | |
| return null; |
NewerOlder