Hello, everyone.
I have made the decision to start moving away from CodeCombat (I am sorry to see you go) and start working on a more professional scale.
CodeCombat, you have been a great help, and I am more than happy to keep this community alive. I will check back in every once in a while to see what’s up.
But on that note, for those who are looking for something more than just premade programs, and feel as though you are ready for a larger scale come talk to me. While I am no expert, I am looking forward to sharing tips and tricks with you in the future.
If you head over to .NET fiddle, you can find a functional online console for you to experiment with, which is what I use for my C# mad science stuff.
This is a great chance to use the stuff you have learned in CodeCombat to practical use.
6 Likes
Much appreciated. This platform got me started on the fundamentals of coding and I will always be partial to it.
2 Likes
I hope you do great and will one day find this as a career. I’m sure that if you stick to it, you will.
Yodaniese:
Great and will one day find this as a career I hope you do. To it i’m sure that if you stick, you will.
What are you doing/saying? I think it’s kinda spamming, don’t you?
using System;
public class Program{
public static void Main(){
while(true){
Console.WriteLine("Insert a number into the console to square root it.");
double number = (double)Convert.ToDouble(Console.ReadLine()); //Converts the input variable to a double
if(number > 0){
double numSqrt = Math.Sqrt(number);
Console.WriteLine("");
Console.WriteLine(numSqrt);
Console.WriteLine("");
Console.WriteLine("Rounded up to the nearest whole number is: "+Math.Ceiling(numSqrt));
Console.WriteLine("Rounded down to the nearest whole number is: "+Math.Floor(numSqrt));
}else if(number ==0){
Console.WriteLine("0");
}else if(number < 0){
Console.WriteLine("This is traditionally impossible, but here's what I can do for you...");
double numberSqrtNeg = Math.Sqrt(Math.Abs(number));
Console.WriteLine("");
Console.WriteLine(numberSqrtNeg+"i");
Console.WriteLine("");
Console.WriteLine("Rounded up to the nearest whole number is: "+Math.Ceiling(numberSqrtNeg)+"i");
Console.WriteLine("Rounded down to the nearest whole number is: "+Math.Floor(numberSqrtNeg)+"i");
}
Console.WriteLine("");
}
}
}
Self teaching can be vry slow sometimes.
Cant tell you how many times i tried to convert a string to a double before googling.
1 Like
using System;
public class Program{
public static void Main(){
Console.WriteLine("IN PROGRESS DONT JUDGE");
Console.WriteLine("");
while(true){
Console.WriteLine("Please create a password that is at least 8 characters long and uses one symbol: ");
string password = Console.ReadLine();
int passwordLength = password.Length;
if(passwordLength < 8){
Console.WriteLine("Invalid Password...");
}else{
int passwordSymbolCheck = password.IndexOf("!","?","#","%","$","@","&"); //Overload error help me
if(passwordSymbolCheck > 0){
Console.WriteLine("Password eligible");
}else{
Console.WriteLine("Please use a symbol.");
}
}
}
}
}
Im trying to find a way to see if it includes any of these variables, but I’m getting an overload error. Is there a way I can include all of this without having to take like 20 lines?
1 Like
using System;
public class Program{
public static void Main(){
while(true){
string cons = ("CONSOLE:");
Console.WriteLine(cons+"Create a password that is at least 8 characters long and uses at least one symbol and one number: ");
string password = Console.ReadLine();
int passwordLength = password.Length; //Checks the length of the password
if(passwordLength < 8){
Console.WriteLine("");
Console.WriteLine(cons+"Please make your password at least 8 characters long.");
Console.WriteLine("");
}else{
//Symbol Check
int passwordSymbolCheck = 0;
int checkExclamation = password.IndexOf("!");
if(checkExclamation >0){
passwordSymbolCheck += 1;
}int checkQuestion = password.IndexOf("?");
if(checkQuestion >0){
passwordSymbolCheck +=1;
}int checkPound = password.IndexOf("#");
if(checkPound > 0){
passwordSymbolCheck +=1;
}int checkAnd = password.IndexOf("&");
if(checkAnd > 0){
passwordSymbolCheck +=1;
}int checkPercent = password.IndexOf("%");
if(checkPercent > 0){
passwordSymbolCheck +=1;
}int checkDollar = password.IndexOf("$");
if(checkDollar > 0){
passwordSymbolCheck +=1;
}int checkAsterisk = password.IndexOf("*");
if(checkAsterisk > 0){
passwordSymbolCheck +=1;
}int checkAt = password.IndexOf("@");
if(checkAt > 0){
passwordSymbolCheck +=1;
}int checkBracketLeft = password.IndexOf("[");
if(checkBracketLeft > 0){
passwordSymbolCheck +=1;
}int checkBracketRight = password.IndexOf("]");
if(checkBracketRight > 0){
passwordSymbolCheck +=1;
}int checkParenthLeft = password.IndexOf("(");
if(checkParenthLeft > 0){
passwordSymbolCheck +=1;
}int checkParenthRight = password.IndexOf(")");
if(checkParenthRight > 0){
passwordSymbolCheck +=1;
}
//Numbers Check
if(passwordSymbolCheck > 0){
int passwordNumberCheck = 0;
int checkZero = password.IndexOf("0");
if(checkZero > 0){
passwordNumberCheck +=1;
}int checkOne = password.IndexOf("1");
if(checkOne > 0){
passwordNumberCheck +=1;
}int checkTwo = password.IndexOf("2");
if(checkTwo >0){
passwordNumberCheck +=1;
}int checkThree = password.IndexOf("3");
if(checkThree > 0){
passwordNumberCheck+=1;
}int checkFour = password.IndexOf("4");
if(checkFour > 0){
passwordNumberCheck +=1;
}int checkFive = password.IndexOf("5");
if(checkFive > 0){
passwordNumberCheck +=1;
}int checkSix = password.IndexOf("6");
if(checkSix > 0){
passwordNumberCheck +=1;
}int checkSeven = password.IndexOf("7");
if(checkSeven > 0){
passwordNumberCheck +=1;
}int checkEight = password.IndexOf("8");
if(checkEight > 0){
passwordNumberCheck +=1;
}int checkNine = password.IndexOf("9");
if(checkNine > 0){
passwordNumberCheck +=1;
}
//Now to check if it works
if(passwordNumberCheck > 0){
Console.WriteLine("");
Console.WriteLine(cons+"Password is eligible");
Console.WriteLine("");
}else{
Console.WriteLine("");
Console.WriteLine(cons+"Please use a number");
Console.WriteLine("");
}
}else{
Console.WriteLine("");
Console.WriteLine(cons+"Please use a symbol.");
Console.WriteLine("");
}
}
}
}
}
And now to streamline aaaaaaaaaaaa
1 Like
How I streamline e
using System;
public class Program{
public static void Main(){
while(true){
Console.WriteLine("CONSOLE: Create a password that is at least 8 characters long and uses at least one symbol and one number: ");
string password = Console.ReadLine();
int passwordLength = password.Length;
if(passwordLength < 8){
Console.WriteLine("");
Console.WriteLine("CONSOLE: Please make your password at least 8 characters long.");
Console.WriteLine("");
}else{
int passwordSymbolCheck = 0;
if(password.IndexOf("!") >0){
passwordSymbolCheck += 1;
}if(password.IndexOf("?") >0){
passwordSymbolCheck +=1;
}if(password.IndexOf("#") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("&") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("%") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("$") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("*") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("@") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("[") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("]") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf("(") > 0){
passwordSymbolCheck +=1;
}if(password.IndexOf(")") > 0){
passwordSymbolCheck +=1;
}if(passwordSymbolCheck > 0){
int passwordNumberCheck = 0;
if(password.IndexOf("0") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("1") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("2") >0){
passwordNumberCheck +=1;
}if(password.IndexOf("3") > 0){
passwordNumberCheck+=1;
}if(password.IndexOf("4") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("5") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("6") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("7") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("8") > 0){
passwordNumberCheck +=1;
}if(password.IndexOf("9") > 0){
passwordNumberCheck +=1;
}if(passwordNumberCheck > 0){
Console.WriteLine("");
Console.WriteLine("CONSOLE: Password is eligible");
Console.WriteLine("");
}else{
Console.WriteLine("");
Console.WriteLine("CONSOLE: Please use a number");
Console.WriteLine("");
}
}else{
Console.WriteLine("");
Console.WriteLine("CONSOLE: Please use a symbol.");
Console.WriteLine("");
}
}
}
}
}
1 Like
I need some assistance with something. Anyone who is a person of culture may contribute. This is a project that is important to me. You dont need to know that much C# in order to help.