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 | 67.51M
Immersive StorylineDiverse CharactersRomantic ChoicesDynamic World-BuildingMultiple EndingsConclusionEnchanted Hearts is a captivating mobile game that invites you on an extraordinary journey of self-discovery, love, and supernatural intrigue. The st
Simulation | 50.22MB
Become the culinary master you always dreamed of being. Dive into the delicious chaos of Cooking Madness.Indian Cooking Madness Games brings a rich variety of recipes from around the world. Explore diverse levels and enjoy cooking gameplay that feels
Simulation | 190.38M
Immersive and realistic simulation Common and easily accessible card collection Collect all trading cards like a true TCG enthusiast Stunning dynamic visuals and 3D graphics Conclusion TCG Card Shop Tycoon 2 is the highly anticipated seq
Board | 147.7 MB
Challenge your friends in this thrilling multiplayer board game!Welcome to Board Games: Backgammon محبوسه, where excitement meets strategy! Dive into the world of classic board games with a twist. Play Backgammon and Mahbusse (محبوسة) - also known as
Simulation | 26.31M
Ever fantasized about mentoring your very own ninja? In Clumsy Ninja Mod APK, you get to guide and train a bumbling apprentice on their path to becoming a master. Though they start with basic skills, your ninja's epic journey begins with small, caref
Simulation | 125.88M
Idle Planet Miner is a compelling idle clicker game that lets players mine resources from numerous planets to construct and grow their cosmic mining empire. Players can pilot a spaceship, enhance their mining robots, and research innovative technolog