binary operations
Blitz3D Forums/Blitz3D Programming/binary operations
| ||
Hi Just wandering if blitz supports binary operations? |
| ||
thanks, just one more thing, are there more and that? |
| ||
I think that's all there is. Pretty much all you need. What more are you looking for btw? |
| ||
I'm not really someone who is helping me read file formats was wandering if blitz supported binary operations and is begining to think that blitz3d is not a good programing enviroment. so i'm sending him an email with the binary operation commands in it so he can help me. |
| ||
Ah, well it has most of the ones i can think of :) |
| ||
What exactly are you looking for Goober? Like Ross C says I really can't figure out what binary operators you think you are missing. There is of course the the MAGIC binary operation that always returns exactly what you want no matter what you put in or how you use it, but then again I've yet to see a programming language that has sucessfully implemented that... :) //PetBom |
| ||
That's ~, not Not ;o) YAN |
| ||
Or: Repeat answer = "?" For i = 0 to infinity-1 tmp = Rand(0,infinity-1) answer = ConvertToCharsInGroupsByThree(tmp) Print answer Next Forever If you have enough time you'll evetually find the correct answer to any question you might have. :) Sorry...pressed the post button to early by misstake. And sorry for messing up this thread. I guess I'm just bored :) |
| ||
Can some make sense of this for me please? try searching net to see what do they need. its a binary math for example 1 and 1 = 1, 1 and 0 = 0, 0 and 1 = 0, 0 and 0 = 0 and returns 1 if both operands are 1 else it returns 0 or returns 1 if at least one operand is 1 not returns opposite of operand xor switches operand1 if operand2 is 1 and so on |
| ||
Print 1 And 1 Print 1 And 0 Print 0 And 1 Print 0 And 0 Print "---" Print 1 Or 1 Print 1 Or 0 Print 0 Or 1 Print 0 Or 0 Print "---" Print 1 Xor 1 Print 1 Xor 0 Print 0 Xor 1 Print 0 Xor 0 Print "---" Print Not 1 Print Not 0 WaitKey it never hurts to try something, or actually read what people reply, before you ask. |
| ||
thanks, i did read it but did not make sense of what it mean. thanks again for the help. |
| ||
See it like when you compare two things and the result is true or false. If a=1 and b=1 then both are 1, so a and b (are both set) is true. If a=1 OR b=1 then at least one ofem is set, so the result is true when at least one of them is not zero. Example of usage: if (mousedown(1) or mousedown(2)) = true then ... is diffrent from if (mousedown(1) AND mousedown(2)) = true then ... |
| ||
oh, and note, bitwise boolean operators can not only be used to compare stuff, but also to manipulate the bits of numbers. eg: a=%11110 b=%01011 c= a and b c= %01010 the bits in c are set if they are set in a AND b. an other example: a=%100011 b=%001101 c= a OR b c is %10111 the bits in c are set if they are set eighter in a or in b (or in both). |
| ||
thanks for the help. |