lunardog/MEGAKanban

View on GitHub
src/nonsense.js

Summary

Maintainability
A
0 mins
Test Coverage
export const qualities = [
  'able', 'acid', 'angry', 'automatic', 'awake', 'bad', 'beautiful', 'bent',
  'bitter', 'black', 'blue', 'boiling', 'bright', 'broken', 'brown', 'certain',
  'cheap', 'chemical', 'chief', 'clean', 'clear', 'cold', 'common', 'complete',
  'complex', 'conscious', 'cruel', 'cut', 'dark', 'dead', 'dear', 'deep',
  'delicate', 'dependent', 'different', 'dirty', 'dry', 'early', 'elastic',
  'electric', 'equal', 'false', 'fat', 'feeble', 'female', 'fertile', 'first',
  'fixed', 'flat', 'foolish', 'free', 'frequent', 'full', 'future', 'general',
  'good', 'gray', 'great', 'green', 'hanging', 'happy', 'hard', 'healthy',
  'high', 'hollow', 'ill', 'important', 'kind', 'last', 'late', 'left', 'like',
  'living', 'long', 'loose', 'loud', 'low', 'male', 'married', 'material',
  'medical', 'military', 'mixed', 'narrow', 'natural', 'necessary', 'new',
  'normal', 'old', 'open', 'opposite', 'parallel', 'past', 'physical',
  'political', 'poor', 'possible', 'present', 'private', 'probable', 'public',
  'quick', 'quiet', 'ready', 'red', 'regular', 'responsible', 'right', 'rough',
  'round', 'sad', 'safe', 'same', 'second', 'secret', 'separate', 'serious',
  'sharp', 'short', 'shut', 'simple', 'slow', 'small', 'smooth', 'soft',
  'solid', 'special', 'sticky', 'stiff', 'straight', 'strange', 'strong',
  'sudden', 'sweet', 'tall', 'thick', 'thin', 'tight', 'tired', 'true',
  'violent', 'waiting', 'warm', 'wet', 'white', 'wide', 'wise', 'wrong',
  'yellow', 'young']

export const opposites = [
  'awake', 'bad', 'bent', 'bitter', 'blue', 'certain', 'cold', 'complete',
  'cruel', 'dark', 'dead', 'dear', 'delicate', 'different', 'dirty', 'dry',
  'false', 'feeble', 'female', 'foolish', 'future', 'green', 'ill', 'last',
  'late', 'left', 'loose', 'loud', 'low', 'mixed', 'narrow', 'old', 'opposite',
  'public', 'rough', 'sad', 'safe', 'secret', 'short', 'shut', 'simple', 'slow',
  'small', 'soft', 'solid', 'special', 'strange', 'thin', 'white', 'wrong'
]

export const picturables = [
  'angle', 'ant', 'apple', 'arch', 'arm', 'army', 'baby', 'bag', 'ball', 'band',
  'basin', 'basket', 'bath', 'bed', 'bee', 'bell', 'berry', 'bird', 'blade',
  'board', 'boat', 'bone', 'book', 'boot', 'bottle', 'box', 'boy', 'brain',
  'brake', 'branch', 'brick', 'bridge', 'brush', 'bucket', 'bulb', 'button',
  'cake', 'camera', 'card', 'cart', 'carriage', 'cat', 'chain', 'cheese',
  'chest', 'chin', 'church', 'circle', 'clock', 'cloud', 'coat', 'collar',
  'comb', 'cord', 'cow', 'cup', 'curtain', 'cushion', 'dog', 'door', 'drain',
  'drawer', 'dress', 'drop', 'ear', 'egg', 'engine', 'eye', 'face', 'farm',
  'feather', 'finger', 'fish', 'flag', 'floor', 'fly', 'foot', 'fork', 'fowl',
  'frame', 'garden', 'girl', 'glove', 'goat', 'gun', 'hair', 'hammer', 'hand',
  'hat', 'head', 'heart', 'hook', 'horn', 'horse', 'hospital', 'house',
  'island', 'jewel', 'kettle', 'key', 'knee', 'knife', 'knot', 'leaf', 'leg',
  'library', 'line', 'lip', 'lock', 'map', 'match', 'monkey', 'moon', 'mouth',
  'muscle', 'nail', 'neck', 'needle', 'nerve', 'net', 'nose', 'nut', 'office',
  'orange', 'oven', 'parcel', 'pen', 'pencil', 'picture', 'pig', 'pin', 'pipe',
  'plane', 'plate', 'plough', 'pocket', 'pot', 'potato', 'prison', 'pump',
  'rail', 'rat', 'receipt', 'ring', 'rod', 'roof', 'root', 'sail', 'school',
  'scissors', 'screw', 'seed', 'sheep', 'shelf', 'ship', 'shirt', 'shoe',
  'skin', 'skirt', 'snake', 'sock', 'spade', 'sponge', 'spoon', 'spring',
  'square', 'stamp', 'star', 'station', 'stem', 'stick', 'stocking', 'stomach',
  'store', 'street', 'sun', 'table', 'tail', 'thread', 'throat', 'thumb',
  'ticket', 'toe', 'tongue', 'tooth', 'town', 'train', 'tray', 'tree',
  'trousers', 'umbrella', 'wall', 'watch', 'wheel', 'whip', 'whistle', 'window',
  'wing', 'wire', 'worm' ]

export const generals = [
  'account', 'act', 'addition', 'adjustment', 'advertisement', 'agreement',
  'air', 'amount', 'amusement', 'animal', 'answer', 'apparatus', 'approval',
  'argument', 'art', 'attack', 'attempt', 'attention', 'attraction',
  'authority', 'back', 'balance', 'base', 'behavior', 'belief', 'birth', 'bit',
  'bite', 'blood', 'blow', 'body', 'brass', 'bread', 'breath', 'brother',
  'building', 'burn', 'burst', 'business', 'butter', 'canvas', 'care', 'cause',
  'chalk', 'chance', 'change', 'cloth', 'coal', 'color', 'comfort', 'committee',
  'company', 'comparison', 'competition', 'condition', 'connection', 'control',
  'cook', 'copper', 'copy', 'cork', 'cotton', 'cough', 'country', 'cover',
  'crack', 'credit', 'crime', 'crush', 'cry', 'current', 'curve', 'damage',
  'danger', 'daughter', 'day', 'death', 'debt', 'decision', 'degree', 'design',
  'desire', 'destruction', 'detail', 'development', 'digestion', 'direction',
  'discovery', 'discussion', 'disease', 'disgust', 'distance', 'distribution',
  'division', 'doubt', 'drink', 'driving', 'dust', 'earth', 'edge', 'education',
  'effect', 'end', 'error', 'event', 'example', 'exchange', 'existence',
  'expansion', 'experience', 'expert', 'fact', 'fall', 'family', 'father',
  'fear', 'feeling', 'fiction', 'field', 'fight', 'fire', 'flame', 'flight',
  'flower', 'fold', 'food', 'force', 'form', 'friend', 'front', 'fruit',
  'glass', 'gold', 'government', 'grain', 'grass', 'grip', 'group', 'growth',
  'guide', 'harbor', 'harmony', 'hate', 'hearing', 'heat', 'help', 'history',
  'hole', 'hope', 'hour', 'humor', 'ice', 'idea', 'impulse', 'increase',
  'industry', 'ink', 'insect', 'instrument', 'insurance', 'interest',
  'invention', 'iron', 'jelly', 'join', 'journey', 'judge', 'jump', 'kick',
  'kiss', 'knowledge', 'land', 'language', 'laugh', 'law', 'lead', 'learning',
  'leather', 'letter', 'level', 'lift', 'light', 'limit', 'linen', 'liquid',
  'list', 'look', 'loss', 'love', 'machine', 'man', 'manager', 'mark', 'market',
  'mass', 'meal', 'measure', 'meat', 'meeting', 'memory', 'metal', 'middle',
  'milk', 'mind', 'mine', 'minute', 'mist', 'money', 'month', 'morning',
  'mother', 'motion', 'mountain', 'move', 'music', 'name', 'nation', 'need',
  'news', 'night', 'noise', 'note', 'number', 'observation', 'offer', 'oil',
  'operation', 'opinion', 'order', 'organisation', 'ornament', 'owner', 'page',
  'pain', 'paint', 'paper', 'part', 'paste', 'payment', 'peace', 'person',
  'place', 'plant', 'play', 'pleasure', 'point', 'poison', 'polish', 'porter',
  'position', 'powder', 'power', 'price', 'print', 'process', 'produce',
  'profit', 'property', 'prose', 'protest', 'pull', 'punishment', 'purpose',
  'push', 'quality', 'question', 'rain', 'range', 'rate', 'ray', 'reaction',
  'reading', 'reason', 'record', 'regret', 'relation', 'religion',
  'representative', 'request', 'respect', 'rest', 'reward', 'rhythm', 'rice',
  'river', 'road', 'roll', 'room', 'rub', 'rule', 'run', 'salt', 'sand',
  'scale', 'science', 'sea', 'seat', 'secretary', 'selection', 'self', 'sense',
  'servant', 'sex', 'shade', 'shake', 'shame', 'shock', 'side', 'sign', 'silk',
  'silver', 'sister', 'size', 'sky', 'sleep', 'slip', 'slope', 'smash', 'smell',
  'smile', 'smoke', 'sneeze', 'snow', 'soap', 'society', 'son', 'song', 'sort',
  'sound', 'soup', 'space', 'stage', 'start', 'statement', 'steam', 'steel',
  'step', 'stitch', 'stone', 'stop', 'story', 'stretch', 'structure',
  'substance', 'sugar', 'suggestion', 'summer', 'support', 'surprise', 'swim',
  'system', 'talk', 'taste', 'tax', 'teaching', 'tendency', 'test', 'theory',
  'thing', 'thought', 'thunder', 'time', 'tin', 'top', 'touch', 'trade',
  'transport', 'trick', 'trouble', 'turn', 'twist', 'unit', 'use', 'value',
  'verse', 'vessel', 'view', 'voice', 'walk', 'war', 'wash', 'waste', 'water',
  'wave', 'wax', 'way', 'weather', 'week', 'weight', 'wind', 'wine', 'winter',
  'woman', 'wood', 'wool', 'word', 'work', 'wound', 'writing', 'year'
]

export const technobabble = [
  'alternative',
  'algorithm',
  'analysis',
  'anomaly',
  'approximation',
  'conjecture',
  'conundrum',
  'convergence',
  'compensator',
  'capacitor',
  'derivation',
  'decoupling',
  'expedition',
  'experiment',
  'element',
  'factor',
  'fluctuation',
  'function',
  'fallacy',
  'hypothesis',
  'inversion',
  'implementation',
  'malfunction',
  'modulator',
  'metaphor',
  'observation',
  'particle',
  'potential',
  'paradigm',
  'paradox',
  'pathway',
  'principle',
  'reaction',
  'relativism',
  'reduction',
  'subroutine',
  'symphony',
  'topology',
  'theory'
]

export function pickOne(set) {
  return set[Math.floor(Math.random() * set.length)]
}

export function randomNumber() {
  let number = Math.round(Math.random() * 90) + 10
  let numbers = [
    ['nr', number],
    ['of', 1900 + number],
    [number * 100]
  ]
  return pickOne(numbers)
}

export function randomSet() {
  let adjectives = [pickOne(qualities), pickOne(generals)]
  let nouns = [pickOne(picturables), pickOne(picturables), pickOne(generals)]
  return ['the', pickOne(adjectives), pickOne(nouns), pickOne(technobabble)]
}

module.exports = {
  randomSet: randomSet,
  randomNumber: randomNumber
}