Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge: Identify ways to use XOR logical operator
#15
XOR? Mmmh..

1.- I use it often to create a cheap texture
Code:
screen 13
for i=0 to 63
for j=0 to 63
   pset(i,j),i xor j
next j,i

Edited: Nr 2 did'nt worked...


3.- The CRC algorithm is based on XOR
(Code ripped from ABC)

Code:
CRC = 0                                        'Reset for Each Text Block
FOR I = 1 TO LEN(B$)                           'Calculate for Length of Block
   ByteVal = ASC(MID$(B$, I, 1))
   FOR J = 7 TO 0 STEP -1
      TestBit = ((CRC AND 32768) = 32768) XOR ((ByteVal AND Power(J)) = Power(J))
      CRC = ((CRC AND 32767&) * 2&)
      IF TestBit THEN CRC = CRC XOR &H1021&     ' <-- This for 16 Bit CRC
   NEXT J
NEXT I
CRC16& = CRC

4.- The sprite animation technique often suggested to newbies:

Excuse me if it's not exactly like this, you never find those darn snippets when you need them...

Code:
PUT (x,y), mask(0), XOR
PUT(X,Y),SPRITE(0),PSET

edited:

BTW: Have you ever used EQV ? Not me....
Antoni
Reply


Messages In This Thread
To Seph: - by Moneo - 06-21-2003, 07:41 AM
To LooseCaboose: - by Moneo - 06-21-2003, 08:59 AM
To drV: - by Moneo - 06-21-2003, 09:24 AM
Re: To drV: - by DrV - 06-21-2003, 09:39 AM
To Toonski84 - by Moneo - 06-21-2003, 10:03 AM
Challenge: Identify ways to use XOR logical operator - by Antoni Gual - 06-21-2003, 01:23 PM
Re: To drV: - by relsoft - 06-22-2003, 02:20 PM
Sample reason for using XOR. - by Moneo - 06-23-2003, 09:33 PM
Update: - by Moneo - 07-03-2003, 11:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)