Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Procedure printSentenceInChatStream is
- -- Variable declaration
- -- Each element of the array will be a string of characters like mySentecesList:= ("hi world", "Hi mate, how are you", "etc")
- mySentencesList = type array();
- 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
- timer = type time; -- each 15 minutes or 10 min
- -- Declaration of functions and procedures
- function randomIntegerNumber (sentences: type array) return integer
- x = type integer;
- -- the vaule of x will be an integer beetwen first element of the array and the last element of the array
- x:= random(sentences.FirstElementOfTheArray(), sentences.LastElementOfTheArray());
- return x;
- function checkPassedtime (timePassed: type time) return boolean
- timer: type time;
- timer:= timePassed;
- a: boolean;
- begin
- a:= false;
- -- here some operations for check passed time. I dont know wich ones. I am lost here.
- return a;
- Procedure printInChatStreamMsg(x: type integer, msg: type string) is
- begin
- printInChat(msg(x));
- end printInchatStreamMsg;
- -- start program
- begin
- mySentencesList.addElement:= ("Hi world");
- mySentencesList.addElement:= ("Few are those who see with their own eyes and feel with their own hearts.");
- mySentencesList.addElement:= ("Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.");
- mySentencesList.addElement:= ("Unthinking respect for authority is the greatest enemy of truth.");
- mySentencesList.addElement:= ("Try not to become a man of success, but rather try to become a man of value.");
- mySentencesList.addElement:= ("I am by heritage a Jew, by citizenship a Swiss...");
- -- Here i would add more sentences
- x:= randomIntegerNumber(mySentencesList());
- If checkPassedTime(timer) then
- printInChatStreamMsg(x,mySentencesList(x));
- en if;
- end printSentenceInChatStream;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement