Dave Kuhlman wrote:
> On Wed, Dec 19, 2007 at 09:41:13PM -0500, bob gailer wrote:
>
>> 1 - I see no value in introducing variables. I'd just use string constants:
>>
>> action = "moving"
>> .
>> .
>> if action == "jumping":
>>
>> etc.
>
> I agree. But, some people do prefer something that looks
On Wed, Dec 19, 2007 at 09:41:13PM -0500, bob gailer wrote:
> 1 - I see no value in introducing variables. I'd just use string constants:
>
> action = "moving"
> .
> .
> if action == "jumping":
>
> etc.
I agree. But, some people do prefer something that looks a bit
like an enum. If so, here i
Jim Morcombe wrote:
> In a program, I want to set some kind of variable or object to
> indicate what "mode" the program is currently in.
> What is the most elegant way of doing this?
>
> Jim
> ---
> constant: moving = "m"
>
This isn't elegant, but it is a start. My method is: get SOMETHING working,
then work from there. 8^D
"""
constant: moving = "m"
constant: inserting = "i"
constant: jumping = "j"
.
.
action = moving
.
.
.
if action == jumping:
jumpSomewhere()
elseif action == moving:
moveSomewhere()
elseif
In a program, I want to set some kind of variable or object to indicate what
"mode" the program is currently in.
What is the most elegant way of doing this?
Jim
---
constant: moving = "m"
constant: inserting = "i"
constant:ju