I am not sure what is happening in the code, but I do know that = will store a value. So LastCommand = 0 will set LastCommand to 0. Meanwhile, a == will test for equality. So LastCommand ==0 will test to see if LastCommand is equal to 0 or not. If it is, true is returned, if not, false is returned. Use = for setting variables, and use == in if statements, while statements, etc.
Whoops. Copy and paste got me. Not the first nor the last time that’ll happen.
I tend to do insane multitasking in class. Pretty sure I wrote this in Advanced Programming a course that bores me to tears. I am usually switching between email, whatever homework I happen to be doing, sort of listening to the “lecture” and doing whatever else seems like it’ll make the deathgrip and migraine that comes with having to watch some professor who barely understands how to communicate with human beings try to explain concepts he/she (she in this case) barely understands.
That’s why a class called Advanced is in actuality an Intro to Java course. Something I don’t need and am thoroughly … angry … my department is making me, scratch that, forcing me to endure.
But yeah, back to screwing up the most simple boolean algebra ever!
As a university professor, I can tell you how these classes get named:
(Prog 101) Introduction to programming - The microwave. Class will cover all aspects of programming: Standard time lengths, use of delayed start, management of power levels, defrost cycles. More advanced topics like the “Popcorn” and “Pizza” buttons will be covered in a special Saturday Seminar that is open to the public.
(Prog 102) Introduction to programming - The VCR. (Prereq Prog 101) This class will cover programming the home VCR. Initial setup of the time and date, cable / antenna, daily, weekly and special event programming and the use of “plus time” to capture sporting events of variable length. Note: Discussions around VHS vs Beta vs Optical Disk will be covered in a joint session with Tech 102.
(Prog 201) Advanced Programming: Java. This class will cover all aspects of programming modern coffee equipment from simple K-cup to more complex cafe-mocha-steamed-extra shots-no whipped cream factory devices. Programming bean roasters, grinders and air tight packing machines is also covered.
(Prog 202) Advanced Programming: Introduction to Java. Programming the modern computer will be covered …
See, it really is an advanced class :rolleyes: Tough it out, get the easy A. Tutor the students that don’t get it for some extra cash or free pizza.
At least you don’t have to endure half a year of nicely formatting your excel documents. Compulsory in my year, a whole hour 5 times a week of turning images of excel documents into excel documents. Then listening to our teacher explain the average function for the one-quadrillionth time