[haskell] color finder

Viewer

copydownloadembedprintName: color finder
  1. keyWord :: String
  2. keyWord = "VIBGYOR"
  3.  
  4. keyWordLength = length keyWord - 1
  5.  
  6. number = 8
  7.  
  8. colorChoice number = if number <= keyWordLength
  9.                        then  keyWord `elem` number
  10.                      else keyWord `elem(keyWordLength `mod` number) 

Editor

You can edit this paste and save as new:


File Description
  • color finder
  • Paste Code
  • 04 Sep-2023
  • 265 Bytes
You can Share it: