1 The following is a demonstration of the guess.d script,
4 guess.d is a guessing game written in DTrace. It goes like this,
7 guess.d - Guess a number between 1 and 100
22 Correct! That took 7 guesses.
24 Please enter your name: Brendan Gregg
30 It was written as a demonstration of the same code written in dozens of
31 languages. It makes a good demonstration, as it covers integer and string
32 variables, conditional statements, loops, keyboard input, screen output,
33 and file input and output.
35 Written in DTrace however, is not such a good demonstration! DTrace doesn't
36 have loops (it doesn't really need them either) which made the code a
37 little odd. DTrace also doesn't have keyboard input... So this script is
38 somewhat amusing as an example, but not terribly useful.