
-----------------------------------
why1234
Sat Jun 19, 2010 8:28 pm

boolean help
-----------------------------------
how do you use boolean?

-----------------------------------
DtY
Sat Jun 19, 2010 8:39 pm

RE:boolean help
-----------------------------------
boolean myBoolean := true;

If you have a more specific question, it might be possible to give meaningful help.

-----------------------------------
Euphoracle
Sat Jun 19, 2010 8:43 pm

RE:boolean help
-----------------------------------
A boolean is one of two things: true or false.  You can create a variable for like like this:


var tehEpicBool : boolean := true


Anything you evaluate that is either true or false, right or wrong, is a boolean.  Eg.


put (5 > 3)
% this will print 'false'
put (9 >= 9)
% this will print 'true'
put (6 not= 4)
% this will print 'true'


Booleans are used to test conditions mostly.

eg.


var i := 1
loop
    put i
    i := i + i
    exit when i > 99
    %when the value of i is greater than 99, this will be true and the 'exit' command will leave the loop
end


-----------------------------------
Monduman11
Sat Jun 19, 2010 10:43 pm

Re: RE:boolean help
-----------------------------------
A boolean is one of two things: true or false.  You can create a variable for like like this:


var tehEpicBool : boolean := true


Anything you evaluate that is either true or false, right or wrong, is a boolean.  Eg.


put (5 > 3)
% this will print 'false'
put (9 >= 9)
% this will print 'true'
put (6 not= 4)
% this will print 'true'


umm no offence but for the first 1 its true cause 5 is bigger than 3, i think u ment to write 3 > 5 not 5> 3

Booleans are used to test conditions mostly.

eg.


var i := 1
loop
    put i
    i := i + i
    exit when i > 99
    %when the value of i is greater than 99, this will be true and the 'exit' command will leave the loop
end


-----------------------------------
Euphoracle
Sat Jun 19, 2010 11:25 pm

RE:boolean help
-----------------------------------
whoops wrong key.

-----------------------------------
Cezna
Sun Jun 20, 2010 7:52 am

Re: boolean help
-----------------------------------
If you are unclear on what a boolean variable is, I suggest you read through a tutorial on Turing, either the one from Holtsoft, or [url=http://compsci.ca/v3/viewtopic.php?t=8808&highlight=attaching+files+compsci]this one.

-----------------------------------
Insectoid
Sun Jun 20, 2010 10:54 am

RE:boolean help
-----------------------------------
Or, even better, [url=http://en.wikipedia.org/wiki/Boolean_data_type]wikipedia, since booleans are global types and not restricted to Turing. 

Think about it this way.

An integer can have any value from -max to max. A boolean can only have 0 to 1 (or false to true).

-----------------------------------
andrew.
Sun Jun 20, 2010 11:50 am

RE:boolean help
-----------------------------------
It's not 0 to 1, it's 0 or 1.

-----------------------------------
TWizard
Fri Jul 02, 2010 9:02 pm

RE:boolean help
-----------------------------------
Lol. You can do the same thing with number as you can with true or false. Boolean is mostly used in is statments try useing the built in guide or look though the online guides. Instead of posting something and not looking or just want to get the awnser. Here is a small example



var Var : boolean
var number

put "What is 2 x 2 "
get number

if number = 4 then
Var := true
else
Var := false
end if
% To test if it was true or false

if Var = true then
put "Correct"
else
put "False"
end if



In truth thats the slack way I hope its useful and dont always think people will give the awnser your looking for with out know what you want.
