efficieny: a program checking for a 1 vs a busy is not going to run 10 times slower, yeesh get a grip lol
Efficieny also incorporates how robust something is, at least when dealing with programming. Checking for exact strings isn't robust.
Falacy wrote:
efficieny: a program checking for a 1 vs a busy is not going to run 10 times slower, yeesh get a grip lol Efficieny also incorporates how robust something is, at least when dealing with programming. Checking for exact strings isn't robust. |
Falacy wrote:
using more variables: im not using more then 1 variable? im just setting canmove="Busy" canmove="KOed" etc... With bit flags, you can set your "canmove" variable to both KOed and Busy at the same time. With your method, only one at a time is supported. It would be better to use bit flags for it. Not only is it more efficent (since you're dealing with multiple variables all put into one) but it's also easier to use within your code (since you never need to check if the "canmove" equals to anything else). #define KOed 1 Such a code would turn "KOed" on if it's off. If it's already on, this code is ignored. |
In an atom's New() proc, the first argument is always its location. This is set automatically for atoms. Therefore, you shouldn't deviate from that. The lasso should be created using three arguments: The location, the owner, and the target. If you like you can always set the location again manually then.
For robustness' sake, you should avoid making the first argument of atom/New() anything but an atom unless it's meant to be a screen object and won't have a physical location. Conversely if it's not meant to have a physical location, you should avoid letting the first argument be an atom. Lummox JR |
CaptFalcon33035 wrote:
Are their any understandable guides on bitflags anyway? I never really understood them. Check out my bit flags article on BYONDscape. |
I didn't bother reading anyone's but the first post, but the way I do it is when the obj's "head" moves, I have it create a tail on its curent location before it moves again and repeat the process. I have it delete itself in the tails New() after a certain amount of time too.
|
Falacy wrote:
using less data: since i doubt byond 1s and 0s are actualy boolean, and instead are integers, they would take up more memory then a character, ie B, but a whole string ie Busy would probably be more yes Wrong, actually. A string needs to be allocated separately in memory, but the ID for it is just a 4-byte identifier just as BYOND's numbers are 4-byte floating point. Lummox JR |
if Falacy doesn't want to use boolean shortcuts via intergers and have different status, it's okay as long as he keeps track of what he's doing.
If you are doing an interger method, similar to Falacy, likewise.. if you know what you are doing and prefer it that way, it's your choice to keep your style or change it.
If you like using bitwise intergers for purposes of mixing effects... welcome to the club ;)
Besides, this is way too off-topic :D
- GhostAnime - Sadly, is slightly amused