Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(device).
- -compile([export_all]).
- print({gotoxy,X,Y}) ->
- io:format("\e[~p;~pH",[Y,X]);
- print({printxy,X,Y,Msg}) ->
- io:format("\e[~p;~pH~p",[Y,X,Msg]);
- print({clear}) ->
- io:format("\e[2J",[]);
- print({tlo}) ->
- print({printxy,2,4,1.2343}),
- io:format("",[]) .
- printxy({X,Y,Msg}) ->
- io:format("\e[~p;~pH~p~n",[Y,X,Msg]).
- formatTime({HH,Mm,Ss})->
- integer_to_list(HH)++":"++integer_to_list(Mm)++":"++integer_to_list(Ss).
- formatTemperature({Value})->
- integer_to_list(Value)++" C".
- formatSeason(spring)->
- "Spring";
- formatSeason(summery)->
- "Summer";
- formatSeason(autumn)->
- "Autumn";
- formatSeason(winter)->
- "Winter".
- display({TimeX,TimeY,TWidth},{SeasonX,SeasonY,SWidth},{TemperatureX,TemperatureY,TempWidth})->
- .
- main()->
- print({clear}),
- TimeFormat = formatTime({17,30,00}),
- printxy({50,20,TimeFormat}),
- printxy({50,21,formatTime({18,30,00})}).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement