Advertisement
Guest User

Untitled

a guest
Jun 8th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 1.93 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. function checkPassedtime (timePassed: type time) return boolean
  16.     timer: type time;
  17.     timer:= timePassed;
  18.     a: boolean;
  19. begin
  20.     a:= false;
  21.     -- here some operations for check passed time. I dont know wich ones. I am lost here.
  22. return a;
  23.  
  24. Procedure printInChatStreamMsg(x: type integer, msg: type string) is
  25. begin
  26.     printInChat(msg(x));   
  27. end  printInchatStreamMsg;
  28.  
  29. -- start program
  30. begin
  31.  
  32. mySentencesList.addElement:= ("Hi world");
  33. mySentencesList.addElement:= ("Few are those who see with their own eyes and feel with their own hearts.");
  34. mySentencesList.addElement:= ("Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.");
  35. mySentencesList.addElement:= ("Unthinking respect for authority is the greatest enemy of truth.");
  36. mySentencesList.addElement:= ("Try not to become a man of success, but rather try to become a man of value.");
  37. mySentencesList.addElement:= ("I am by heritage a Jew, by citizenship a Swiss...");
  38. -- Here i would add more sentences
  39.  
  40. x:= randomIntegerNumber(mySentencesList());
  41. If checkPassedTime(timer) then
  42.     printInChatStreamMsg(x,mySentencesList(x));
  43. en if;
  44.  
  45. end printSentenceInChatStream;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement