grumpymonkey:
to this:del=(del<0||del>20)?0:a?del+1:c?del-1:del;
Just because you can do that, does not mean you should. While you can understand that, not everyone else can and it makes it hard later on for someone to understand what you're trying to do.
Personally, if I use that, I keep it very simple:var = (foo) ? bar : baz
The moment you start adding other comparisons in that, you start to make things complicated. It's much, much better, cleaner, and easier to read to simply use if/then/else ... what you're saving in memory space, if that, isn't anything anyway.
The same applies to this:
if (foo) {
bar
}
versus:
if (foo) bar
You're saving nothing.