+ 12
[ASSIGNMENT] Start with This Challenge #1
The Challenge is to make a Low-High Game in any language you may prefer to use. Description Of Game: A Game in which user has to enter a Number between 1 to 10(or what you want). The Number should be equal to Random Number generated by computer. Example are there for your help :- https://code.sololearn.com/cCy5FZ23L0fS/#rb An Upvote Please.
13 Answers
+ 11
First C code:
https://code.sololearn.com/cS1Oscl6nwq1/#c
+ 11
Something like this :
https://code.sololearn.com/cgan9xUZ6o4K/?ref=app
+ 10
https://code.sololearn.com/cZoXv7svk8Bb/?ref=app
+ 7
https://code.sololearn.com/c5jRCGQqt1nl/?ref=app
+ 7
First Java code:
(Give it as many inputs as you want and it'll loop through all of them)
https://code.sololearn.com/c901nJcgR0sl/#java
import java.util.Random;
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Random rand = new Random();
int randNum = 0;
int userInput = 0;
boolean isPlaying = true;
while(isPlaying) {
System.out.println("Please input guess: ");
userInput = scnr.nextInt();
System.out.println(":::Your guess is " + userInput + ":::");
randNum = (rand.nextInt(10) + 1);
System.out.println(":::Random number is " + randNum + ":::");
if(userInput == randNum) {
System.out.println("+++WINNER!+++");
} else {
if(userInput > randNum){
System.out.println(">>>Your guess is too high! LOSER!<<<");
} else if (userInput < randNum){
System.out.println(">>>Your guess is too low! LOSER!<<<");
}
}
System.out.println("");
}
}
}
+ 5
This c++ code:
You can set minimum and maximum values that computer & You can choose
https://code.sololearn.com/ce5hBN5L5Xmj/#cpp
don't forget to upvote <3 ^_^
+ 5
First time working with Random class in C#, not sure if Next() is inclusive on both, or only on the first. Anyhow, here:
https://code.sololearn.com/cEyzW7zhGTde/?ref=app
+ 4
Learning the basic html. any guess when I'll be good enough to do it?
+ 4
In C, except 1 - 10 instead of 0 - 9.
https://code.sololearn.com/c8S2tP6DmjxK/#c
+ 3
(Application of random function)
https://code.sololearn.com/ci12MbRj1H3k/?ref=app