Difference between revisions of "TI-BASIC:SK:Exercises Games"

From Learn @ Cemetech
Jump to navigationJump to search
(Automated internal link correction)
(Automated internal link correction)
 
Line 34: Line 34:
  
 
{{Template:TI-BASIC:Next-prev
 
{{Template:TI-BASIC:Next-prev
|prevpage = TI-BASIC:SK:Summary-games
+
|prevpage = TI-BASIC:SK:Summary_Games
 
|prevtitle = Summary
 
|prevtitle = Summary
 
|tocpage = TI-BASIC:Starter_Kit
 
|tocpage = TI-BASIC:Starter_Kit
 
|toctitle = Table of Contents
 
|toctitle = Table of Contents
|nextpage = TI-BASIC:SK:Chase-the-star
+
|nextpage = TI-BASIC:SK:Chase_The_Star
 
|nexttitle = Sample Program: Chase the Star}}[[Category:TI-BASIC]]
 
|nexttitle = Sample Program: Chase the Star}}[[Category:TI-BASIC]]
 
[[Category:TIBD]]
 
[[Category:TIBD]]

Latest revision as of 00:56, 25 February 2016

Review

  1. What command will automatically unarchive a list and create it if it doesn't exist?
  2. What data type would you use to save a highscore?
  3. What is the seed and what is it useful for?
  4. What type of loop is appropriate to use for a game like Yahtzee?
  5. What is the code for movement?
  6. How can you modify the movement code in order to make it so that when you go off the screen, you loop to the other side?
  7. Can you use the sub( command to find the element in a matrix?
  8. Make a formula using rand as the only random command to yield the same results as randBin( with a given seed of 0.
  9. What happens when you take the inverse of a matrix with determinant 0?

Programming

Modify the following movement code that is supposed to move two objects simultaneously according to user input.

:1→A
:1→B
:4→C
:4→D
:Repeat K=21
:getKey→K
:If Ans
:Output(A,B,"_")
:min(8,max(1,A+sum(ΔList(Ans={25,34}))))→A
:min(16,max(1,B+sum(ΔList(K={24,26}))))→B
:Output(A,B,"X")
:End

Explain the usage for this code.

:rand→A
:A→rand

Create a game where the player must make it through a maze when the arrow key movements are jumbled up.

<< Summary Table of Contents Sample Program: Chase the Star >>