Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Use this tag for programs that interact with their user by means of a character-based console or terminal
0
votes
Display the n terms of even natural numbers(between 1 and 100) and their sum
This can almost be a "one-liner" using LINQ:
Console.Write("How many even numbers :");
int numberOfEvenNumbers = Convert.ToInt32(Console.ReadLine());
int[] numbers = Enumerable.Range(1, 100).Where(c …
2
votes
First program: a simple calculator
So I've done the following:
use of an enum as opposed to the magic number constants used for operations.
use of multiple methods, to wit, one to determine what operation was selected and another to …
13
votes
Accepted
Console calculator for 2 numbers at a time
Some rules of thumb:
If you have your entire program in a single method (Main(), in this case), there are some design considerations you should probably revisit. Especially from a DRY ("Don't Repeat …
3
votes
RPG character creation implementation
Your code is "incorrect" in quite a few ways, from naming conventions, to separation of concerns (UI vs. object creation) to bedrock principles (such as principle of least privilege - public member va …
3
votes
Change desktop background
Image also implements IDisposable, therefore wrap in using:
using (Image background = downloadBackground(URL + getResolutionExtension()))
{
saveBackground(background);
setBackground(backgroun …
6
votes
Accepted
Simple N Puzzle console game
I think you're real close to the ask of the problem. I have two main bits for you to change up:
Your Tile class has no way of setting the tile value. Change so that it does. I think immutability is u …