Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 turing question pls help thnk you
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
collinquan




PostPosted: 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
Sponsor
sponsor
ProgrammingFun




PostPosted: 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




PostPosted: 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




PostPosted: Mon Oct 17, 2011 7:42 pm   Post subject: RE:turing question pls help thnk you

lol, the banhammer fell (PM spam? seriously?)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ProgrammingFun




PostPosted: 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? Laughing
Tony




PostPosted: Mon Oct 17, 2011 7:46 pm   Post subject: RE:turing question pls help thnk you

Yeah. Bad move.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ProgrammingFun




PostPosted: 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 Sad
This guy should be IP blocked...looks like someone ran a script.
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Aange10




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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!"
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: