To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 338
337  |  339
Subject: 
Re: NQC wishlist
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 5 Jan 2000 12:53:59 GMT
Viewed: 
1859 times
  
This works as a 1-based 16 element array of Boolean variables...

// Boolean constants
#define TRUE 1
#define FALSE 0

// Boolean storage - bye bye var 0
int bSys = 0;

// Boolean array defines
#define bool(i)       ((bSys & (i^2)/2) == (i^2)/2)
#define setbool(i,v)  bSys = (bSys | (1<<(i-1))) - ((1<<(i-1)) * (v^1))


--
Mark R

www.markrendle.co.uk



Message is in Reply To:
  Re: NQC wishlist
 
(...) I'm not really comfortable with variable-length bit allocations since this isn't something that happens in C outside of structs. But there could still be a couple "smaller" types. Right now an int is 16 bits. Perhaps a char could be 8 bits, (...) (25 years ago, 23-Nov-99, to lugnet.robotics.rcx.nqc)

17 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR