Skip to content

JamesCobbledick/Kuflink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kuflink Backend Test Answer

This solution will allow you to use certain emojis as operands in calculations.

Installation

To run this, please use the following command, replacing the filepath with the location of this file. This will create a local server using PHP's built in webserver.

php -S 127.0.0.1:80 -t C:\filepath\

You can then enter any number into the operand fields and select an emoji to use as the operator, click calculate to see the result.

Usage

emoji_calculate($userEmoji, $operand1, $operand2)

Approach

I took the approach of displaying the emojis to the user using a html entity, this meant that the PHP backend could easily encode and decode the chosen emoji and respective stored html entity to identify which operand to use.

This means that it would be fairly simple to store the acceptable emojis in a database, with the corresponding operand and only update the calculate(); method to handle new operands.

License

MIT

About

Kuflink Backend Test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages