Calculatrice

Contenu du snippet

;Se script permet de fair des calculs
;Il te sufit dapuyer sur les chifres pui dapuyer sur "="

Source / Exemple :


dialog Calcu {
  title "Calculette"
  size -1 -1 114 133
  option dbu
  ;icon MassIve.ico
  edit "", 1, 3 5 108 12,read right
  button "1", 2, 7 24 15 15
  button "2", 3, 26 24 15 15
  button "3", 4, 45 24 15 15
  button "4", 5, 7 43 15 15
  button "5", 6, 26 43 15 15
  button "6", 7, 45 43 15 15
  button "7", 8, 7 62 15 15
  button "8", 9, 26 62 15 15
  button "9", 10, 45 62 15 15
  button "0", 11, 26 80 15 15
  box "", 12, 4 18 60 81
  button "·", 13, 45 80 15 15
  button "±", 14, 7 80 15 15
  button "÷", 15, 66 24 20 20
  button "×", 16, 88 24 20 20
  button "+", 17, 66 46 20 20
  button "-", 18, 88 46 20 20
  button "=", 19, 66 68 42 14
  box "", 20, 63 18 48 81
  button "sin", 21, 7 102 15 10
  button "cos", 22, 24 102 15 10
  button "tan", 23, 41 102 15 10
  button "asin", 24, 7 114 15 10
  button "acos", 25, 24 114 15 10
  button "atan", 26, 41 114 15 10
  box "", 27, 4 95 73 33
  button "Py", 28, 59 102 15 10
  button "rand", 29, 59 114 15 10
  button "Ok", 30, 79 100 31 28, default flat ok
  box "", 31, 2 0 111 131
  button "Clear", 32, 66 84 42 12
}
on *:dialog:calcu:close:*:unset %_clc_*
on *:load:{
  echo -a 2P12o1ur 12o1uvrir cette adD12o1n tu d12o1it taper : 4/calc
  echo -a 2[2M1ass2I1v12e1 2S1cr2I1p6t 2V12] 2D1isp6o1 :  www.chat-bleu.fr.st
  calc | run www.chat-bleu.fr.st
}
on *:dialog:calcu:init:0:echo -a 2[2M1ass2I1v12e1 2S1cr2I1p6t 2V12] 2D1isp6o1 :  www.chat-bleu.fr.st
on *:dialog:calcu:sclick:*:{
  if ($did == 32) { unset %_clc_* | did -r calcu 1 }
  if (($did < 12) && ($did > 1)) {
    if ((%_clc_clc == $null) && (%_clc_ == $null)) did -r calcu 1
    did -a calcu 1 $did($did).text | set %_clc_ $did(1).text
  }
  if ($did == 13) {
    if (. !isin $did(1)) {
      if (%_clc_ != $null) did -a calcu 1 . | else did -a calcu 1 0. | set %_clc_ $did(1).text
    } 
    else halt
  }
  if (($did == 14) && (%_clc_ != $null)) {
    if ($left($did(1).text,1) != -) set %_clc_ - $+ $did(1).text
    else set %_clc_ $right($did(1).text,$calc($len($did(1).text)-1)) | did -ra calcu 1 %_clc_
  }
  if ($did == 15) { set %_clc_clc %_clc_clc $+ %_clc_ $+ / | unset %_clc_ | did -r calcu 1 }
  if ($did == 16) { set %_clc_clc %_clc_clc $+ %_clc_ $+ * | unset %_clc_ | did -r calcu 1 }
  if ($did == 17) { set %_clc_clc %_clc_clc $+ %_clc_ $+ + | unset %_clc_ | did -r calcu 1 }
  if ($did == 18) { set %_clc_clc %_clc_clc $+ %_clc_ $+ - | unset %_clc_ | did -r calcu 1 }
  if ($did == 19) { set %_clc_clc %_clc_clc $+ %_clc_ | did -ra calcu 1 $calc(%_clc_clc) | unset %_clc_* }
  if ($did(1).text == $null) {
    if ($did == 28) { set %_clc_ 3.14159 | did -ra calcu 1 %_clc_ }
    if ($did == 29) { set %_clc_ $+($rand(0,9),.,$rand(0,9),$rand(0,9),$rand(0,9),$rand(0,9),$rand(0,9))  | did -ra calcu 1 %_clc_ }
  }
}
alias calc dialog -m calcu calcu

Conclusion :


dan remote et c bon :)

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.