Zar

Zar

3.5
Download
Download
Game Introduction

This is a simple dice rolling game application. The user can specify the number of dice to roll and the number of sides on each die. The application then simulates rolling the dice and displays the results.

Here's a possible implementation in Python:

import random

def roll_dice(num_dice, num_sides):
  """Simulates rolling multiple dice.

  Args:
    num_dice: The number of dice to roll.
    num_sides: The number of sides on each die.

  Returns:
    A list of integers representing the results of each die roll.  Returns an empty list if num_dice is 0 or less.
  """
  if num_dice <= 0:
    return []
  return [random.randint(1, num_sides) for _ in range(num_dice)]

def main():
  """Gets user input and runs the dice rolling simulation."""
  while True:
    try:
      num_dice = int(input("Enter the number of dice to roll (or 0 to exit): "))
      if num_dice == 0:
        break
      num_sides = int(input("Enter the number of sides on each die: "))
      if num_sides <=0:
        print("Number of sides must be greater than 0.")
        continue

      results = roll_dice(num_dice, num_sides)
      print("Results:", results)
      print("Total:", sum(results))

    except ValueError:
      print("Invalid input. Please enter integers only.")

if __name__ == "__main__":
  main()

This code first defines a function roll_dice that takes the number of dice and the number of sides as input and returns a list of the results. The main function handles user interaction, prompting for input and validating it. It then calls roll_dice and prints the results and the total. The while True loop allows the user to roll multiple times until they enter 0. Error handling is included to catch non-integer inputs. This provides a basic but functional dice rolling application. More advanced features could be added (e.g., a graphical user interface, different types of dice, saving scores).

Zar Screenshot 0
Zar Screenshot 1
Zar Screenshot 2
Zar Screenshot 3
Reviews Post Comments
Latest Games More +
Puzzle | 79.18M
Get ready to sprint into action with Sonic Dash 2, the follow-up to the hugely popular Sonic Dash. Created by SEGA, this game carries on the Sonic the Hedgehog legacy in a fast-moving, thrilling adventure. Race through colorful worlds, grab power-ups
Role Playing | 48.65MB
Ultimate simulator game that you command muscled mutant herd! Control muscled mutant herd during fascinating travels and adventures in the vast world inhabited by different beasts. Fight against other beasts and wild animals. Take the herd, explore t
Action | 13.18MB
Sling Bird Hunter offers the most lifelike experience for hunting birds, ducks, vultures, and sparrows in a mobile game.While "Sling Bird Hunter" is designed for mobile, don't let the name fool you—it features thrilling duck hunting too! It is the pr
Action | 10.91MB
A thrilling zombie shooter where you must survive in a city overrun by the infected.◆ Searching for an exciting zombie game? You've definitely come to the right place!◆ Discover the most exhilarating zombie shooting game you'll ever play. Our TPS zom
Card | 29.00M
Step into the world of Greg's Universe, a unique indie fan-made project where you can interact intimately with your favorite DILF from Steven Universe - Greg. As you play, you'll discover a range of interactions and activities to engage in, from givi
Action | 65.31MB
Gaia Survivor: ChroniclesDive into an unforgettable adventure in "Gaia Survivor: Chronicles." This captivating RPG seamlessly blends survival mechanics with rich world-building. Explore expansive landscapes, forge powerful alliances, and uncover the