Skip to content

bargross/button-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

90s Phone Button Converter

While learnig how to program with Haskell, the guide I am reading proposes a challenge to practice data types, which is to build a program which converts button presses to either a tuple or a list containig two tuples denoting a capital letter:

Either (Char, Int) [('*', Int), (Char, Int)]

The first aim of the excercise is to practice creating a data structure which captures the layout of the keypad.

Then create a series of functions which convert characters to the following:

  • If lower case then return a tuple of (Pressed key, number of presses)
  • If the Char is a number or special character such as "+_^" etc... then return a tuple of (Pressed key, number of presses)
  • If the Char is an upper case letter then return a list of tuples of [(First pressed key *, number of presses), (Pressed key, number of presses)] where * represents the first key pressed when denoting an upper case letter.

Phone keypad layout:


xhHq4v.jpg.5b81e82e81bbe3677356d3d27196e1c9.jpg..jpg

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors