-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.ts
35 lines (26 loc) · 1.1 KB
/
debug.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//Typescript is my new wify'
function useMagnifyingGlass():void{
console.log('I will use my magnifying glass.')
}
function determineCulprit(){
return Math.floor(Math.random()*2+1)
}
function doSleuthing(numberOfClues:string, clue1:string, clue2:string, suspect1:any, suspect2:any):string{
console.log('I am a famous detective and I will solve the crime.');
let unnecessaryVariable:any = 'Why is this here?'
unnecessaryVariable=useMagnifyingGlass();
console.log('Now I consider the first clue: ',clue1);
console.log('Now I consider the second clue: ',clue1);
let culpritNumber:any = determineCulprit();
console.log('Now, I will return to you the culprit. There but for the grace of God go we.' );
if(culpritNumber == 1) {
return(suspect1)
}
if(culpritNumber == 2) {
return(suspect2)
}
return "I couldn't figure out who drank the priceless milk. :( :("
}
let answer: any=3;
answer=doSleuthing('2', 'The parrot heard everything!', 'All the doors and windows were shut from the INSIDE.', 'Burglar Bob', 'Saint Sam')
console.log('The culprit was none other than ', answer, '!');