473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Basic guessing program

I am looking on some help on a program where i have the user enter a random number from say 1-20. I do it until number is chosen. Meanwhile it tells the user it it has gotten cooler or warmer from their last guess.

ty, any help is appreciated.
Oct 16 '07 #1
8 2152
nev
251 100+
I don't understand...
Oct 17 '07 #2
Killer42
8,435 Expert 8TB
I am looking on some help on a program ...
Our experts are generally happy to help. But you need to give us some idea of what to help with.

What version of VB are you using? What have you tried? What are you having trouble with?
Oct 17 '07 #3
Vb6, i have tried doing such as using 2 vars, 1 for first input and 1 for next input so it is easier. But i have not gone far, it wont display right answer.
Oct 17 '07 #4
Ali Rizwan
925 512MB
I am looking on some help on a program where i have the user enter a random number from say 1-20. I do it until number is chosen. Meanwhile it tells the user it it has gotten cooler or warmer from their last guess.

ty, any help is appreciated.
I think He/She want to make a programe having artificial intelligence which will guess the mood of user either it is Cool or Warmer from their last guess.
Is it right?
I think?
GOODLUCK
ALI
Oct 17 '07 #5
Actual number is 16.
For instance, the user guesses 5 the first time;
the user guesses 8 the second time; Msgbox - "you got warmer than your last guess"
the user guesses 7 the third time; Msgbox-"you got colder"
It basically loops around until number is guessed.
Oct 17 '07 #6
debasisdas
8,127 Expert 4TB
Actual number is 16.
For instance, the user guesses 5 the first time;
the user guesses 8 the second time; Msgbox - "you got warmer than your last guess"
the user guesses 7 the third time; Msgbox-"you got colder"
It basically loops around until number is guessed.
From your logic it seems ,only checking if the previous number is greater or lesser that the current number will be sufficent.

> Hotter
< Cooler

= ???
Oct 17 '07 #7
Killer42
8,435 Expert 8TB
From your logic it seems ,only checking if the previous number is greater or lesser that the current number will be sufficent.

> Hotter
< Cooler
No, the logic is that "hotter" or "warmer" means closer to the right answer. "Cooler" means further away, or "more wrong".

This is a fairly common technique (in some countries) for indicating whether someone is getting closer to or further away from the correct answer, or place.
Oct 17 '07 #8
kadghar
1,295 Expert 1GB
This is a fairly common technique (in some countries) for indicating whether someone is getting closer to or further away from the correct answer, or place.
Yeap, here in mexico it's very common. then i think you can just define 3 integers (k,m,n) lets make k the "correct answer" with

k = int(rnd*20)+1

and then it should look like:

Expand|Select|Wrap|Line Numbers
  1. m=inputbox ("First guess")
  2.     do
  3.         if m = k then exit do
  4.         n=imputbox("next guess")
  5.         if (m-k)^2 > (n-k)^2 then 
  6.             msgbox("warmer")
  7.         elseif (m-k)^2 > (n-k)^2 then 
  8.             msgbox("cooler")
  9.         else
  10.              msgbox("neither cooler nor warmer")
  11.         end if
  12.         m=n
  13.      loop
  14. msgbox("congrats")
HTH
Oct 17 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
1
by: bidalah | last post by:
Hello, I am looking for basic info on installing and using MSDE. I am trying to install and play with MSDE on my PC (Win2000). I finally managed to work my way through installation, and named...
4
by: sathyashrayan | last post by:
(This is not a home work question) Dear group, I want a program to find one number between a set of natural number.A program to guess a number in between a Natural number set.This should be a...
10
by: trippeer | last post by:
I have the source code to an old BASIC program that a friend of mine would like to run online. I am a beginner at JS, but I think that it would be a good choice for the project. My background is in...
4
by: moopower | last post by:
I have to do the following: For this project, you are to create a simple number guessing game. The program should begin by asking the user for a range (i.e. a minimum number and a maximum number)...
6
by: Simon Walsh | last post by:
I'm an Electronics student in college and I'm currently working on a project. I was given a circuit diagram for my project, from which I had to design a printed circuit board to be sent off and...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
0
by: Dan Upton | last post by:
On Wed, May 21, 2008 at 12:55 PM, abhilash pp <afilash+python@gmail.comwrote: That won't work as written, because it'll print "you failed," then break, then print "You guessed it!"... As an...
11
by: =?Utf-8?B?UGV0ZXIgSw==?= | last post by:
I am working with Visual Studio or alternately with Expression Web. I need to create about 50 aspx pages with about 1200 thumbnali images, typically arranged in three to four groups per page,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.