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 +
Simulation | 125.16M
Indian Train Simulator MOD is a train simulation game where players get unlimited resources and immediate access to all content. With boosts like infinite money and gems, plus every train and station unlocked from the beginning, you can tailor your e
Action | 54.20M
SAMURAI II: VENGEANCE is a celebrated action fighting game, known for its distinctive hand-drawn art style and compelling revenge-driven narrative. You embody a legendary Samurai fueled by rage and a profound thirst for vengeance against those who be
Action | 154.30M
Welcome to the magical world of Pumpkin Panic APK, a place alive with whimsical pumpkins, hidden secrets, and heroic adventures. Dive into this engaging mobile game packed with action, mind‑bending puzzles, and a colorful fantasy setting. Step into t
Sports | 77.00M
Experience the most competitive badminton matches ever! Challenge your friends in 1 vs 1 mode or compete for the Badminton League trophy in Tournament Mode! Personalize your character with a wide range of items and level up your abilities to deliver
Action | 56.58M
Step into a world where every punch echoes with the pulse of high-octane gaming. Anger of Stick 5 is more than just a game; it’s an adrenaline-fueled adventure that keeps you on the edge of your seat, craving for more. With its gripping narrative and
Puzzle | 130.34M
Happy Color is a relaxing and entertaining color-by-number painting game. Players fill in various black-and-white images using matching number codes. It features diverse categories like animals, nature, food, and more.Explore a World of Vivid Colors