Skip to content

luisbotteri/python-riddle-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🔢 Number Guessing Game / Juego de Adivinar el Número

English

Description

A classic command-line Number Guessing Game implemented in Python. The program selects a random secret number between 0 and 100. The player has a limited number of attempts (7 tries) to guess the number. The game provides hints after each incorrect guess, indicating whether the secret number is higher or lower than the input.

Features

  • Random Number Generation: The secret number is randomly chosen from 0 to 100 using the random module.
  • Limited Attempts: The player is given a maximum of 7 attempts.
  • Hints: Provides feedback ("higher" or "lower") after each incorrect guess.
  • Input Validation: Handles non-integer inputs gracefully.
  • Replayability: Allows the user to easily start a new game after one ends.

Prerequisites

  • Python 3.x installed on your system.

How to Run

  1. Save the code as a Python file (e.g., guessing_game.py).
  2. Open your terminal or command prompt.
  3. Run the script using the following command:
    python guessing_game.py
  4. Type 'Sí' or 'Si' when prompted to start the game.

Español

Descripción

Un clásico Juego de Adivinar el Número de línea de comandos implementado en Python. El programa selecciona un número secreto aleatorio entre 0 y 100. El jugador tiene un número limitado de intentos (7 intentos) para adivinar el número. El juego proporciona pistas después de cada intento incorrecto, indicando si el número secreto es mayor o menor que la entrada.

Características

  • Generación de Número Aleatorio: El número secreto se elige al azar entre 0 y 100 usando el módulo random.
  • Intentos Limitados: El jugador tiene un máximo de 7 intentos.
  • Pistas: Proporciona retroalimentación ("mayor" o "menor") después de cada intento incorrecto.
  • Validación de Entrada: Maneja entradas que no son números enteros correctamente.
  • Rejugabilidad: Permite al usuario comenzar un nuevo juego fácilmente después de que uno termina.

Requisitos Previos

  • Python 3.x instalado en tu sistema.

Cómo Ejecutar

  1. Guarda el código como un archivo de Python (por ejemplo, adivinar_numero.py).
  2. Abre tu terminal o símbolo del sistema.
  3. Ejecuta el script usando el siguiente comando:
    python adivinar_numero.py
  4. Escribe 'Sí' o 'Si' cuando se te solicite para iniciar el juego.

About

I made a guessing game in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages