Psuedo Code for hi_lo

Psuedo Code for hi_lo - else if x < y, say...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
set y at random integer set count to zero ask "what number am i thinking of" input number = x set count to count + 1 while x is not y, and count <= 7 if x > y, say "that number is too high" ask "what number am i thinking of" input number;set count to count +1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else if x &lt; y, say &quot;that number is too low&quot; ask &quot;what number am i thinking of&quot; input number; set count to count + 1 if x is not y and count &gt; 7 say &quot;you lose.&quot; if x is y and count &lt;= 7 say &quot;congraduations, you win&quot;...
View Full Document

This note was uploaded on 04/03/2010 for the course COMPSCI 600.107 taught by Professor Houlahan during the Spring '08 term at Johns Hopkins.

Ask a homework question - tutors are online