how can i code this

player1=rock
player2= paper

player two wins

please help me

Recommended Answers

All 9 Replies

how to code this one?

DEFINE FUNCTION GetInput( Input Text as string ) returns character
..declare result as character value ' '
..LOOP WHILE ( result is no R S or P )
....output (text) (Rock, Scissors, Paper)
....input result
..END LOOP
..return result
END FUNCTION

MAIN ENTRY POINT
..declare Player1 as character value ' '
..declare Player2 as character value ' '
..Player1 = GetInput("Player 1")
..CLEAR SCREEN
..Player2 = GetInput("Player 2")
..CLEAR SCREEN
..IF( ( Player1 is Paper ) AND (Player2 is Rock) ) THEN output Paper covers Rock, Player 1 wins!
..ELSE IF( ( Player1 is Rock) AND (Player2 is Scissors) ) THEN output Rock breaks scissors, Player 1 wins!
..ELSE IF( ( Player1 is Scissors) AND (Player2 is Paper) ) THEN output Scissors cuts paper, Player 1 wins!
..ELSE IF( ( Player2 is Paper ) AND (Player1 is Rock) ) THEN output Paper covers Rock, Player 2 wins!
..ELSE IF( ( Player2 is Rock) AND (Player1 is Scissors) ) THEN output Rock breaks scissors, Player 2 wins!
..ELSE IF( ( Player2 is Scissors) AND (Player1 is Paper) ) THEN output Scissors cuts paper, Player 2 wins!
..ELSE output Its a Draw!
END MAIN

Convert that pseudo (VB) code into C code.

how can i convert it?

i really dont have an idea

Do you know C?

no i dont know sir.
please help me to code it

:icon_rolleyes:

If you don't know C, you can't. Isn't that obvious?

Search for a C tutorial and start learning..

i just need it for my sister
she cant understand how to code it into c

can you code it sir for me?
please sir..

anyone can help me?

anyone can help me?

You are asking for help. However, what you want is different from help. You want someone to write the program for you.
This forum is not for that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.