tarotlib.py

Created by golem64

Created on December 22, 2021

2.01 KB

Mod pour Scoretab : https://my.numworks.com/python/golem64/scoretab

Comptez plus facilement vos points au tarot avec cette bibliothèque !

Pour annuler une suppression de tour, appuyez simplement sur entrée sans rien écrire


from scoretab import *

def edit():
  e()
  if len(scores)<5:
    v=""
    while not v: v=input("Joueur "+str(len(scores)+1)+" > ")
    scores.append([v])
    while len(scores)<3:
      v=""
      while not v: v=input("Joueur "+str(len(scores)+1)+" > ")
      scores.append([v])
  drawTab(scores,p["x"],p["y"],p["s"],p["w"])

def add():
  e()
  global scores
  pr=int(input("Preneur > "))-1
  ap=-1
  if len(scores)==5: ap=int(input("Appel > "))-1
  bo=0
  bo=int(input("Bouts > "))
  if not bo: pa=56
  if bo==1: pa=51
  if bo==2: pa=41
  if bo==3: pa=36
  print("1) Petite\n2) Garde \n3) Garde sans chien\n4) Garde contre chien")
  co=0
  while co<1 or co>4: co=int(input("Contrat > "))
  pt=int(input("Points > "))
  pb=0
  pb=int(input("Petit au bout ? (att/def) > "))
  po=0
#  po=int(input("Poignee ? (att/def/2) > "))
#  if po: pg=int(input("Simple/Double/Triple ? > "))
  ca=0
  cr=0
  ca=int(input("Chelem annonce ? > "))
  cr=int(input("Chelem reussi ? (att/def) > "))
  mi=0
  mi=int(input("Misere ? > "))
  lo=0
  to=pt-pa
  if to<0:
    to=-to
    lo=1
  to+=25
  if pb:
    if pb==2: pb=-10
    else: pb=10
  ch=0
  if ca:
    if cr:
      if cr==2: ch-=200
      else: ch+=400
    else: ch-=200
  else:
    if cr:
      if cr==2: ch-=200
      else: ch+=200
  if co-1: to=to*((co-1)*2)
  if lo:
    ch=-ch
    to=-to
  ch=-ch
  to+=ch
  to+=pb
  for i in range(len(scores)):
    if i!=pr and i!=ap:
      scores[i].append(-to)
  if len(scores)==5 and ap!=pr:
    scores[ap].append(to)
    scores[pr].append(to*2)
  else:
    scores[pr].append(to*(len(scores)-1))
  for i in range(len(scores)):
    if mi:
      if mi-1==i: scores[mi-1][-1]+=(len(scores)-1)*10
      else: scores[i][-1]-=10
  drawTab(scores,p["x"],p["y"],p["s"],p["w"])

def rem():
  global scores
  if scores:
    if len(scores[0])-1:
      e()
      v=0
      v=int(input("Supprimer tour ? > "))
      if v:
        i=0
        for i in range(len(scores)):
          scores[i].pop(p["s"])
        p["s"]=1
      drawTab(scores,p["x"],p["y"],p["s"],p["w"])

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.