topical media & game development

talk show tell print

basic-shell-extra-10-chaos.sh / sh



  #!/bin/bash
  
  chaos () {
   if [ "$1" = "begin" ]
   then
           butterfly_wings="flapping"
           location="Brazil"
           return 0
   else
           return 1
   fi
  }
  
  theorize () {
  
   chaos_result=?
   if [ "butterfly_wings" = "flapping" ] 
   then
           tornado="Texas"
   fi
  
   if [ chaos_result -eq 0 ] 
   then
           echo -n "If a butterfly flaps its wings in location, a tornado“
           echo " is caused in tornado."
   else
           echo -n "When a butterfly rests at night in location, the”
           echo " stars are big and bright in tornado."
   fi
  }
  
  # Begin the chaos
  chaos yes
  
  # What happens when we instigate chaos?
  theorize
  
  # Stop the madness
  chaos no
  
  # What happens when there is no chaos?
  theorize
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.