Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.scripting.vbscript > #11973

Re: hide user input in vb

Newsgroups microsoft.public.scripting.vbscript
Subject Re: hide user input in vb
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <24696fad-a3f0-492f-aeb4-f0688cd0deab@googlegroups.com>
Date 2018-06-07 23:07 +0200
Message-ID <XnsA8FAEB521343Deejj99@194.109.6.166> (permalink)

Show all headers | View raw


lysaali50@gmail.com wrote on 07 Jun 2018 in
microsoft.public.scripting.vbscript: 

> i'm new to visual basic and i want to make a 2 player game where player1
> inputs a number and player2 has to guess it 

This NG is about the scriptig language VBS, NOT about VB.

> 
> i'm having trouble in finding ways to hide user inputs so that player2
> has to actually guess the number 
> 
> here's my code so far:
> Module Module1
> 
>     Sub Main()
>         Dim guess As Integer = 0
>         Dim N2guess As Integer = 0
>         Dim attempts As Integer = 0
>         Dim P1 As String = "P1"
>         Dim P2 As String = "P2"
> 
>         Console.WriteLine("P1, please enter a number between 1-10 ")
>         N2guess = Console.ReadLine()
>         While N2guess < 1 Or N2guess > 10
>             Console.WriteLine("INVALID OPTION")
>             Console.WriteLine("please try again")
>             N2guess = Console.ReadLine()
>         End While
> 
> 
>         While guess <> N2guess And attempts < 5
>             Console.WriteLine("P2 have a guess")
>             guess = Console.ReadLine()
>             attempts = attempts + 1
>         End While
> 
>         If guess = N2guess Then
>             Console.WriteLine("P2 WINS!")
>         Else
>             Console.WriteLine("P1 WINS!")
>         End If
>         Console.ReadLine()
>     End Sub
> 
> End Module
> 



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

hide user input in vb lysaali50@gmail.com - 2018-06-07 13:53 -0700
  Re: hide user input in vb "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-06-07 23:07 +0200
  Re: hide user input in vb "Mayayana" <mayayana@invalid.nospam> - 2018-06-07 17:52 -0400
  Re: hide user input in vb JJ <jj4public@vfemail.net> - 2018-06-08 13:06 +0700
  Re: hide user input in vb "R.Wieser" <address@not.available> - 2018-06-08 10:20 +0200
    Re: hide user input in vb "R.Wieser" <address@not.available> - 2018-06-08 21:49 +0200

csiph-web