Advertisement
Guest User

Untitled

a guest
Jun 8th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 1.94 KB | None | 0 0
  1. Procedure printSentenceInChatStream is
  2. -- Variable declaration
  3. -- Each element of the array will be a string of characters like mySentecesList:= ("hi world", "Hi mate, how are you", "etc")
  4.     mySentencesList = type array();
  5.     x = type integer; -- Minimum value of variable x will be the first element of the array and maximum value will be the max lengh of the array
  6.     timer = type time; -- each 15 minutes or 10 min
  7.  
  8. -- Declaration of functions and procedures
  9. function randomIntegerNumber (sentences: type array) return integer
  10.     x = type integer;
  11.     -- the vaule of x will be an integer beetwen first element of the array and the last element of the array
  12.     x:= random(sentences.FirstElementOfTheArray(), sentences.LastElementOfTheArray());
  13. return x;
  14.  
  15. Procedure checkPassedtime (timePassed: type time) is
  16.     timer: type time;
  17.     timer:= timePassed;
  18. begin
  19.     -- here some operations for check passed time. I dont know wich ones. I am lost here.
  20. end procedure;
  21.  
  22. Procedure printInChatStreamMsg(x: type integer, msg: type string) is
  23. begin
  24.     printInChat(msg(x));   
  25. end  printInchatStreamMsg;
  26.  
  27. -- start program
  28. begin
  29.  
  30. mySentencesList.addElement:= ("Hi world");
  31. mySentencesList.addElement:= ("Few are those who see with their own eyes and feel with their own hearts.");
  32. mySentencesList.addElement:= ("Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.");
  33. mySentencesList.addElement:= ("Unthinking respect for authority is the greatest enemy of truth.");
  34. mySentencesList.addElement:= ("Try not to become a man of success, but rather try to become a man of value.");
  35. mySentencesList.addElement:= ("I am by heritage a Jew, by citizenship a Swiss...");
  36. -- Here i would add more sentences
  37.  
  38. x:= randomIntegerNumber(mySentencesList());
  39. If checkPassedTime(timer) then
  40.     printInChatStreamMsg(x,mySentencesList(x));
  41.     printChatMessage(mySentenceList(x));
  42. en if;
  43.  
  44. end printSentenceInChatStream;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement