|
||||||
| CSharp Tutorials Tutorials for C# |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
||||
|
Re: Check Caps Lock and Num Lock
Very nice, +rep!
__________________
Questions and Answers | Online News and Social Bookmarking | Code and Text Collaboration General Chat Forum |
|
||||
|
Re: Check Caps Lock and Num Lock
Your code is very long-winded and inefficient. For a start, you don't need " = true" on the condition because the whole statement evaluates as a boolean anyway. Secondly, you are printing two things based on a condition. You don't need separate booleans to store the values.
Here is my version of your entire program in two lines: Code:
Console.WriteLine("Number Lock is " + (Console.NumberLock ? "On!" : "Off!"));
Console.WriteLine("Caps Lock is " + (Console.CapsLock ? "On!" : "Off!"));
|
|
||||
|
Re: Check Caps Lock and Num Lock
lol thank you amr and jordan
santa - which one do you think will be less confusing to a beginner? Posted via CodeCall Mobile |
|
||||
|
Re: Check Caps Lock and Num Lock
It is not a program's job to be easy to understand. I cannot accept responsibility for another's incompetence.
![]() If the user is confused, then it's bad. We programmers need to write good code, not some disgusting slop that Termana calls a "tutorial". Shocking. |
|
||||
|
Re: Check Caps Lock and Num Lock
Quote:
-rep
__________________
Questions and Answers | Online News and Social Bookmarking | Code and Text Collaboration General Chat Forum |
|
||||
|
Re: Check Caps Lock and Num Lock
Eh? You are talking nonsense. If I want to test that value, I need only refer to Console.CapsLock, instead of his custom variable, as both are boolean values. And my code is more concise, better than some n00bisb code lawl.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 09:29 AM.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc