BBC BASIC for Windows
Programming >> BBC BASIC language >> IF (....) STATEMENTS http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1390800591 IF (....) STATEMENTS
Post by chrispc on Jan 27th, 2014, 04:29am
Richard; thanks for your Sudoku help. I am still looking into the bitmap stuff. However the code you ended with: IF (num% AND (num%-1)) = 0 THEN just_one_bit_set = TRUE has me confused. I tried the following uses of that form and got these answers: 1. A%=0 B%=0 C%=1 D%=2
IF (D% AND C%)=0 THEN PRINT "YES" ELSE PRINT "NO" ENDIF
2. IF(4 AND 7)<5 THEN PRINT "YES" ELSE PRINT "NO" ENDIF
Then I tried PRINT (4 AND 7) and this gave the answer 4, so I thought maybe it was considering only the first-mentioned number. But 3. IF (7 AND 4)<5 THEN PRINT "YES" ELSE PRINT "NO" ENDIF also gave the answer "YES".
All the above programs gave the answer "YES". Perhaps you dealt with this in your Tutorial notes but I couldn't find it. Can you explain please? Thanks. chrispc
Re: IF (....) STATEMENTS
Post by ScriptBasic on Jan 27th, 2014, 08:20am
Quote:
All the above programs gave the answer "YES".
Your examples (1-3) are printing the correct results.
Re: IF (....) STATEMENTS
Post by admin on Jan 27th, 2014, 08:30am