Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Captcha thingy

Made this in C#. Still learning. Made through a tutorial from Brackeys.

Code
using System

namespace NumberGenerator
    {

class Program
    {
    static void Main(string[] args)
        {
           Random numberGenerator = new Random();

           int num01 = randomNumberGenerator.Next(1,11);
           int num02 = randomNumberGenerator.Next(1,11);

           Console.WriteLine("What is " + num01 + " times " + num02 + "?");

           int answer = Convert.ToInt32(Console.ReadLine());

           if (answer == num01 * num02) {
               Console.WriteLine("Well done. Correct!");
           } else {
                    int responseIndex = numberGenerator.Next(1, 4);

                    switch (responseIndex)

                    Console.WriteLine("Wrong answer. Refresh the page and try again.");
           }

        }
    }
}

Thoughts? Will it work? It's something like the captcha when registering on HF.
congrats u made a program that will place a random number in the captcha. odds of this program getting the number right 0.01% or if more than 4 numbers required this is practically impossible.
(May 15, 2016 03:35 PM)CanadianBacon Wrote:  congrats u made a program that will place a random number in the captcha. odds of this program getting the number right 0.01% or if more than 4 numbers required this is practically impossible.

By the time this succeeds he learned C# Java and 5 other languages. But yeah dude, for learning purposes, everything you make is progress towards learning, so hey, GJ OP! :)
i need this for EuroMillion Lottery... Can i use this?
Ayy lmao all the replies saying it's to solve the captcha, if you took some time and read the code you'd see that its to make text based catchas smh

btw op good job if it's one of your first things.
(May 15, 2016 05:24 PM)uint32 Wrote:  Ayy lmao all the replies saying it's to solve the captcha, if you took some time and read the code you'd see that its to make text based catchas smh

btw op good job if it's one of your first thing.

I know it was a joke lol.
didnt dislike his code ,for his first thing its great, my first code didnt even compare to his awful :)
(May 15, 2016 01:15 PM)hamburgerman Wrote:  
Code
         int responseIndex = numberGenerator.Next(1, 4);

                    switch (responseIndex)

What is the purpose of responseIndex and this switch declaration? Were you planning something for it?

Also you're mixing between new line and continued line braces.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by Consulting DetectiveMar 3, 2020 04:50 AM 2 158 Mar 3, 2020 04:50 AM
Last Post: Consulting Detective
[.NET] by ClusterzIncMar 11, 2019 09:48 AM 10 1,249 Mar 11, 2019 09:48 AM
Last Post: ClusterzInc
[.NET] by Lor‌dMay 4, 2016 08:22 PM 0 187 May 4, 2016 08:22 PM
Last Post: Lor‌d