The reason that the enter key events need to happen twice is becuase the user input value arrives at the event structure at the beginning of the loop iteration but it doesn't read the current value whenever the enter button event fires (you'll see that if you turn on highlight execution, or use a breakpoint/probe inside the event structure). You need to either move the user input into the enter button event (preferred becuaes it's a direct wire) or use a local variable to read the current value (bad style though - it breaks dataflow). You can also use a property node of course, but they are slower than a local variable if all you need is the value.
As you'll see in other people's solutions, it's easier to have a single state and event strucutre for all possible uses of the enter button, but assign a kind of command by using a seperate enum and case structure. If you think about it, the enter key is a sub-state machine in itself becuase it changes it's data and behaviour depending on the value of other preceding states or input data.
I may try the CLD test in a couple of weeks. Here's the ATM exam written in LV12 with AF package version 126.96.36.199.
This took me about 4.5 hours (though I had to pause overnight at 2.5 hours). I didn't do any planning at all: code-and-go all the way.
The UI is the only actor. I really wanted to make the file I/O an actor of its own, as well as a countdown timer (so their FPs could be shown during DEBUG==True), but I'm not THAT fast. Overall, I'm happy with it, for the time spent. Comments are welcome. Requirements pdf included in zip file and in project.
(Cross-posted on lava:http://lavag.org/topic/16715-atm-sample-cld-exam-written-with-actor-framework/)
Here's the Boiler. It took me about six hours, but I spent time writing it in a way that will let me ask practical questions about the theoretical considerations of the Actor Framework.
This is my first complete practise exam (Carwash). Everything done under the 4 hour limit. I aim to complete 2 more over the next few days before my exam on Thursday (gulp!) If anyone could take a look over it and identify things I could improve on, your help would be enormously appreciated. I know I failed on a couple of points like tip strips and labels for some constants. I tried to comment extensively but I may not have described the algorithms sufficiently.
The big thing I'm unhappy with is that the code is vulnerable to people changing the order of stations on the slider control. As the slider control is not an enum, the numerical check I did against it was very dirty. I'm also unhappy with my code that parses the user options and generates the wash sequence as it's not very elegant. If someone can point me in the direction of a more succinct way of doing it I would appreciate that too!
Looking forward to hearing from you guys.
Hello again all,
Here is today's attempt, this time on the ATM exam, completed in 4 hours. I found this one to be a LOT harder than the car wash. I'm looking for any and all criticism. Things I was unhappy with:
Would love to hear from you guys about this one and the previous one I posted if you've got time.
I have just started prepping for my CLD exam. This is my first attempt at an example question and would appreciate any feedback.
It took me quite a bit longer than the required 4 hours, but I know with practice I will get a lot quicker.
Thanks in advance for any feedback.
Hey I know I'm in the same boat as you. I don't seem to be getting much luck with people responding so I'll respond to yours.
Hope some of this is helpful, would love to get your thoughts on mine if you have time?
Wow thanks for the quick response, really helpful.
Now to your program:
I have never had to review someone elses code before so please bare with me. I'll try to be as clear and precise as possible.
After looking at your code, I think mine was really overkill and no wonder it too me so long. Going to have to refine my process to get in under 4 hours.
Well I hope that helped.
The application appears not to be saving the balance changes. When the app runs a second time it doesn't show changes made in previous run, like a deposit for example. The Main Icon is not representative of the functionality. There are a couple of uses of the default values on the structure edges and there seemed to be several wires under structures.
Overall I would say the application has most of the functionality, especially the core functionality, which for the ATM would be the transactions. If this was completed in four hours then it would be a passing effort. Keep in mind this is an informal review covering for the most part just the functionality as I remember it. :-)