Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I need help with boolean it wont run it
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jesse Kazemi




PostPosted: Mon Jun 16, 2014 5:14 pm   Post subject: I need help with boolean it wont run it

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>


What is the problem you are having?
<Answer Here>


Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Jun 16, 2014 7:12 pm   Post subject: RE:I need help with boolean it wont run it

There's a preview bug that cleared the post, but I'll guess it has something to do with your post in another thread:
code:

var answer : boolean
put "Did Jesse go to take the literacy test? True or false?"
get answer
if false then
  put "Ima smack you for thinking of me that way u fool of a took!"
  if true then
    put "Bravo esavo"
    put "Did Jesse pass the literacy test? True or false?"
    get answer
    if false then
      put "Are you bright I did pass it you 'hodog ' russell peters saying!!!"
      if true then
        put "Your a goofy goober you got it right!"
      end if


For indepth look at the if statements, follow tutorial links from The Turing Walkthrough.

It looks like there's a confusion between boolean values, string literals "true" and "false", and boolean expressions. It might help to prompt user replies as "yes/no" instead.

code:

var answer : string
answer := "yes"
if answer = "yes" then
  put "it was yes"
else
  put "it was something else"
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Jesse Kazemi




PostPosted: Tue Jun 17, 2014 11:15 am   Post subject: Re: I need help with boolean it wont run it

Thanks so much tony for the help
Jesse Kazemi




PostPosted: Tue Jun 17, 2014 2:32 pm   Post subject: Re: I need help with boolean it wont run it

50 views and no replies
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: