Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

A console application to an application with graphic how?

console graphic

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 bunny03

bunny03

    CC Lurker

  • New Member
  • Pip
  • 8 posts

Posted 09 June 2014 - 02:46 PM

Hi! For my first post I have a question:

 

Recently, I create a mystery number game in console. Know, i want to do it with graphic, how?

I don't want WinForms!

My code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Openclassroom_Mes_test
{
    class Program
    {
        static void Main(string[] args)
        {
            int choix = 1;
            while(choix == 1)
            {
                int trying = 0;
                int playernumber = 1;
            int mysterynumber = new Random().Next(0, 100);
            Console.WriteLine("Mystery number game");
            while (playernumber != mysterynumber)
            {
                
                Console.WriteLine("Entrez le chiffre que vous pensez(entre 0 - 100):");

                string saisie = Console.ReadLine();
                if (int.TryParse(saisie, out playernumber))
                {
                    if (playernumber < mysterynumber)
                    {
                        Console.WriteLine("High!\n");
                        trying++;
                    }
                    else if (playernumber > mysterynumber)
                    {
                        Console.WriteLine("low!\n");
                        trying++;
                    }
                    else
                    {
                        Console.WriteLine("Congrat!\n");
                        trying++;
                        Console.WriteLine("You win with " + trying + " trying");
                    }

                }
                else
                {
                    Console.WriteLine("Incorrect number");
                }
                }
            Console.WriteLine("New game?1 Yes/Other No");
            string choix2 = Console.ReadLine();
            if (int.TryParse(choix2, out choix))
            {
                if (choix == 1)
                {
                    Console.WriteLine("Again!");
                }
                else
                {
                    Console.WriteLine("This is the end...");
                }
            }
            

            }









        }
            
        }
    }

Thanks ;)



#2 PBJ

PBJ

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 176 posts

Posted 11 June 2014 - 02:41 PM

bunny,

Some well-supported alternatives to WinForms include the following:


Once you decide which library you would like to use, feel free to edit your initial post, and provide more details as to what you would like to do with your given library that you choose.


Edited by PBJ, 11 June 2014 - 02:41 PM.


#3 bunny03

bunny03

    CC Lurker

  • New Member
  • Pip
  • 8 posts

Posted 12 June 2014 - 03:00 AM

I posted this question on 2 other forums and 2 person have said WPF, I will learn WPF Thanks

Do you know where I can have good tutorial?



#4 PBJ

PBJ

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 176 posts

Posted 12 June 2014 - 09:09 AM

bunny,

A good start would be the official microsoft website, which can be found here. Another good source would be WPF-tutorial which has a good amount of information on getting started using WPF.






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download