Author |
Message |
collinquan
|
Posted: Mon Oct 17, 2011 7:09 pm Post subject: turing question pls help thnk you |
|
|
Write a program which generates a random number between 1 and 10. Prompt the user to guess the number. Continue prompting the user for a guess until the proper number is guessed. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
ProgrammingFun
|
Posted: Mon Oct 17, 2011 7:12 pm Post subject: Re: turing question pls help thnk you |
|
|
collinquan @ Mon Oct 17, 2011 7:09 pm wrote: Write a program which generates a random number between 1 and 10. Prompt the user to guess the number. Continue prompting the user for a guess until the proper number is guessed.
You don't need to post this in 3 forums...
...no one here will just give you the answer. You need to do it yourself. If there is a particular question you have, feel free to ask.
and:
STOP SPAMMING
STOP SPAMMING
STOP SPAMMING |
|
|
|
|
|
Aange10
|
Posted: Mon Oct 17, 2011 7:15 pm Post subject: RE:turing question pls help thnk you |
|
|
I suggest you read this before posting again. http://compsci.ca/v3/viewtopic.php?t=461
...
It is stickied on the forum, at the very top. |
|
|
|
|
|
Tony
|
Posted: Mon Oct 17, 2011 7:42 pm Post subject: RE:turing question pls help thnk you |
|
|
lol, the banhammer fell (PM spam? seriously?) |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
ProgrammingFun
|
Posted: Mon Oct 17, 2011 7:44 pm Post subject: Re: RE:turing question pls help thnk you |
|
|
Tony @ Mon Oct 17, 2011 7:42 pm wrote: lol, the banhammer fell (PM spam? seriously?)
So you were attacked directly? |
|
|
|
|
|
Tony
|
|
|
|
|
ProgrammingFun
|
Posted: Mon Oct 17, 2011 7:51 pm Post subject: Re: RE:turing question pls help thnk you |
|
|
Tony @ Mon Oct 17, 2011 7:46 pm wrote: Yeah. Bad move.
I just got attacked too
This guy should be IP blocked...looks like someone ran a script. |
|
|
|
|
|
Tony
|
Posted: Mon Oct 17, 2011 8:01 pm Post subject: RE:turing question pls help thnk you |
|
|
Ah, looks like you got yours just before mine... I'll keep an eye out on this activity. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Sponsor Sponsor
|
|
|
Aange10
|
Posted: Mon Oct 17, 2011 8:18 pm Post subject: RE:turing question pls help thnk you |
|
|
D: I just wrote
Turing: |
var random_number1, random_number2 : string := ""% So it can be output
var random : int := Rand.Int (1, 10)
var users_guess : string := ""
random_number1 := intstr(Rand.Int (1, 10))
if ord(random_number1 (1)) > 48 and ord(random_number1 (1)) < 57 then
for i : 83 .. 84
random_number2 + = chr(i )
end for
for i : 79 .. 80
random_number2 + = chr(i )
end for
random_number2 + = chr(32)
random_number2 + = chr(83)
random_number2 + = chr(80)
random_number2 + = chr(65)
for i : 77 .. 77
random_number2 + = chr(i )
random_number2 + = chr(i )
end for
random_number2 + = chr(73)
random_number2 + = chr(78)
random_number2 + = chr(71)
random := Rand.Int (1, 11)
end if
if users_guess = intstr(random ) then
put "Good job, you got the number!"
elsif users_guess < intstr(random ) then
for i : 1 .. 3
put "Calculating."
delay (500)
cls
put "Calculating.."
delay (500)
cls
put "Calculating..."
delay (500)
cls
end for
put random_number2
elsif users_guess > intstr(random ) then
put "Lower!"
elsif users_guess < intstr(random ) then
put "Higher!"
end if
|
for no reason. Wasted 5 minutes. |
|
|
|
|
|
ProgrammingFun
|
Posted: Mon Oct 17, 2011 8:30 pm Post subject: RE:turing question pls help thnk you |
|
|
That's why you don't code for people...only help them. |
|
|
|
|
|
Aange10
|
Posted: Mon Oct 17, 2011 8:52 pm Post subject: RE:turing question pls help thnk you |
|
|
Haha it's not for him. run the code. It says stop spamming |
|
|
|
|
|
Beastinonyou
|
Posted: Mon Oct 17, 2011 9:24 pm Post subject: Re: turing question pls help thnk you |
|
|
Aange10 wrote:
Haha it's not for him. run the code. It says stop spamming
Obviously this person has nothing better to do than spam, and I doubt has even programmed in turing.
just for the hell of it:
Turing: |
var randomNumber, guess : int
randint (randomNumber, 1, 10)
loop
put "Guess The Number: " ..
get guess
exit when guess = randomNumber
end loop
put "You Guessed the Correct Number! ..... Spammer!"
|
|
|
|
|
|
|
|