Algorithm Game Pseint

1

I find myself playing a game for academic purposes.
Which consists of two players where the main objective of the game is to reduce the opponent's life to 0 in order to determine the winner.

The game consists of turns where each opponent will have an amount of 100pts. to start. Each opponent will have the option to: attack or block the other player in each attack. If the player chooses to attack the opponent and he does not have an active blocking, the attack will be effective and 10pts of life will be deducted from the opponent.

On the other hand, if you choose to block, you will have a 50% chance that the opponent's next attack will not cause you damage, if the attack is blocked. Each attack received or blocked will count at 1 to fill a special attack indicator. , if the special attack counter is of 5 or more, in the corresponding turn, to the options already seen will be added "3.- Special attack, 4.- Recovery". If the player makes a special attack, it can not be blocked and will deduct 30 points of life from the player. If the player makes a recovery, his current life will increase by 10 points, he can not do that if he exceeds 100 initial life points.

At the end of each turn, the game will indicate the life of the player who received the attack, if one of the two players has 0 or fewer points of life, the game will indicate "Player xx, is the winner.

What I have from the algorithm is the following:

Proceso sin_titulo
dimension jugador[2];
definir opc como numero;
definir jugador como caracter;
definir i Como Caracter;
definir j como caracter;
para i<-1 hasta 2 con paso 1 hacer 
    escribir " ingrese el nombre del jugador 1:";
    leer jugador[1];
    i<-jugador[1];
    escribir "seleccione la opcion ",jugador[1];
    Escribir " opcion 1 atacar ";
    escribir " opcion 2 bloquear ";
    escribir " opcion 3 ataque especial ";
    escribir " opcion 4 recuperacion ";
    leer opc;
    si opc = 1 entonces 
        escribir " usted eligio atacar al oponente";
    FinSi
    si opc = 2 entonces 
        escribir " usted ha elegido bloquear";
    FinSi
    escribir"";
    para j<-2 hasta 2 con paso 1 hacer 
     escribir " ingrese el nombre del jugador 2:";
      leer jugador[2];
      j<-jugador[2];
      escribir "seleccione la opcion";
      Escribir " opcion 1 atacar ";
      escribir " opcion 2 bloquear ";
      escribir " opcion 3 ataque especial ";
      escribir " opcion 4 recuperacion ";
      leer opc;
      si opc = 1 entonces 
        escribir " usted eligio atacar al oponente";
      FinSi
      si opc = 2 entonces 
        escribir " usted ha elegido bloquear";
     FinSi
    finpara
finpara
    
asked by camila fernanda larenas tapia 20.06.2018 в 03:21
source

0 answers