Created
August 16, 2017 10:24
-
-
Save marcincembrzynski/fd00fe3eb75c8ea7997afd58c53e02da to your computer and use it in GitHub Desktop.
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
-module(ex1). | |
-export([server/1,pal_check/1,pal_check_answer/1]). | |
server(Pid) -> | |
receive | |
{check, String} -> | |
io:format("got: " ++ String), | |
Pid ! { result, pal_check_answer(String)}, | |
server(Pid); | |
_ -> | |
io:format("stopped") | |
end. | |
pal_check_answer(String) -> | |
A = pal_check(String), | |
case A of | |
true -> String ++ " is palindrome"; | |
false -> String ++ " is not palindrome" | |
end. | |
pal_check(String) -> String == lists:reverse(String). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment