It’s Yearbook Day!

Yearbooks are here and will be distributed later today.

Didn’t order one? It’s not too late! See the flyer below or click the link to sign up at Tree Ring and order yours today for delivery in 2-3 weeks straight to your home. Softcover books are $20 and hardcover are $6.95. Shipping is approximately $8.

You will have the option of creating 2 personalized pages using your own photos, but you may also opt to order a standard, non-customized book. You will need an Adobe Flash enabled browser to create custom pages.

Late Yearbook Flyer


You’ll need to join my classroom for the next few class sessions. You may use this tool the rest of your lives… It’s extremely handy and allows you to run code in most programming languages and even build web pages for testing!

To join, click me! If you already have an account, just sign in. If you don’t have an account, I STRONGLY suggest using Google log in and using your Gmail account. That way, you can’t forget your password! If you want to keep your account after you leave Dallas ISD, you can always add a username and password or change your email address later.

Day 3 Program

Today we wrote our Nspire version of a dice roll simulation. Here’s an example of the function that simulated 1 or more trials of 6 dice.

Define dice(trials)=
 Local i,roll,counts,total_rolls
 For i,1,total_rolls
 Return counts

And here’s the program that ran multiple trials to determine the experimental probability of rollling 1,2,3,4,5,6 each the same number of times.

Define rollsim(trials,c)=
 Local i,counter,roll
 For i,1,trials
 If roll={1,1,1,1,1,1}*c Then
 Disp "all the same: "&string(counter)
 Disp "EP:"&string(((counter)/(trials))*100.)&"%"
 Return ((counter)/(trials))*1.

Day 2 Program — Guess!

Here’s at least one way to make the program from class. I’ve added some spaces to make it more readable, but they’re NOT required on the calculators.

Define guess()=
 Local num, trial, guessed, guesses


 Disp num

 While not guessed
   Request "Guess (1-10)?",trial,0
   If trial=num Then
   ElseIf trial<num Then
     Disp "Too low!"
   ElseIf trial>num Then
     Disp "Too high!"

  local prt
  prt := string(guesses)
  Disp "You got it in" & prt & " guesses."


Nspire Programming notes

To create a new program:

  • Create a new document
  • Insert a program with
    • Add Program Editor
    • New
  • Name your program (no spaces or symbols)
  • Choose Function or Program

Remember that you must  pick function or program correctly as you cannot change it later.

Useful functions

  • Disp — displays output — Menu,  6, 1
    ex: Disp “Hello, world!”       Hello, world!
          Disp x                                42
  • Mean — calculates the mean of a list of values
    ex: Mean({3,4,5})                     4
  • Abs — calculates absolute value of a number or members of a list
    ex: abs({-3,4,-5})                   {3,4,5}
           |{-3,4,-5}|                        {3,4,5}
  • String — converts a number to a string to allow concatenation
    ex: String(42)              42
    Disp “It took ” & string(guesses) & ” tries.”


  • Variables must be declared before use
  • Variables can be global or local, but we will only use local
  • Local variables exist only inside your program
  • Don’t confuse the assignment operator, := , with the comparison operator, =


  • Your program may accept parameters
  • Parameters can be
    • Numbers
    • Lists
    • Text
  • If the parameter is the wrong type (or missing),
    your program won’t execute.


  • Lists are created using curly braces {}
  • Lists can contain other objects like text or numbers
  • The calculator has a number of functions like Mean, Median, etc. that operate on lists
  • To access a specific member of a list, use listname[position]
    ex: x := {5,6,7,8}                                       {5,6,7,8}
    x[2]                                                          6