SHARE
TWEET

dupa-dupa

a guest Dec 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -module(device).
  2. -compile([export_all]).
  3. print({gotoxy,X,Y}) ->
  4.    io:format("\e[~p;~pH",[Y,X]);
  5. print({printxy,X,Y,Msg}) ->
  6.    io:format("\e[~p;~pH~p",[Y,X,Msg]);
  7. print({clear}) ->
  8.    io:format("\e[2J",[]);
  9. print({tlo}) ->
  10.   print({printxy,2,4,1.2343}),
  11.   io:format("",[])  .
  12.  
  13. printxy({X,Y,Msg}) ->
  14.    io:format("\e[~p;~pH~p~n",[Y,X,Msg]).
  15.  
  16. formatTime({HH,Mm,Ss})->
  17.     integer_to_list(HH)++":"++integer_to_list(Mm)++":"++integer_to_list(Ss).
  18.  
  19. formatTemperature({Value})->
  20.   integer_to_list(Value)++" C".
  21.  
  22. formatSeason(spring)->
  23.   "Spring";
  24. formatSeason(summery)->
  25.   "Summer";
  26. formatSeason(autumn)->
  27.   "Autumn";
  28. formatSeason(winter)->
  29.   "Winter".
  30.  
  31.  
  32. display({TimeX,TimeY,TWidth},{SeasonX,SeasonY,SWidth},{TemperatureX,TemperatureY,TempWidth})->
  33.   .
  34.  
  35.  
  36. main()->
  37.   print({clear}),
  38.   TimeFormat = formatTime({17,30,00}),
  39.   printxy({50,20,TimeFormat}),
  40.   printxy({50,21,formatTime({18,30,00})}).
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top