יוצר: Vendetta
גירסא: 2.1
תיאור: מחשבון גרפי , מציג נתונים למשאוות ממעלה שנייה
הפעלה: קליק ימיני Graphic Calculator
דרישות: כל מירק מעל 6.21 כלל
תמונה:
http://up203.siz.co.il/up3/kmuox0dzclty.jpg
קוד: בחר הכל
;;;;;;;;;;;;;;;;;;;;;;; Graphic Calculator 2.1 By Vendetta ;;;;;;;;;;;;;;;;;;;;;;;
//noop $Garaf(1,x^2 ,1)
alias Garaf {
noop $Skizha($1,$2,$3)
drawtext -rp @Page- $+ $1 $color(01) 10 1 $2
drawtext -rp @Page- $+ $1 $color(01) 10 15 ———————...
drawtext -rp @Page- $+ $1 $color(01) 10 29 $3
var %mokom 43
set %nishaA $makadmim($2)
set %nishaB $makadmim($3)
var %hotihX $shorsim($gettok(%nishaA,3,32),$gettok(%nishaA,2,32),$gettok(%nishaA,1,32))
if (%hotihX) {
drawtext -rp @Page- $+ $1 $color(01) 3 %mokom hitoh X: $+($chr(40),$gettok(%hotihX,1,32),$chr(44),0,$chr(41)) $iif($gettok(%hotihX,2,32),$+($chr(40),$gettok(%hotihX,2,32),$chr(44),0,$chr(41)))
var %mokom $calc(%mokom + 14)
}
var %hotihy $calc($gettok(%nishaA,1,32) / $gettok(%nishaB,1,32))
if (%hotihy) {
drawtext -rp @Page- $+ $1 $color(01) 3 %mokom hitoh Y: $+($chr(40),0,$chr(44),%hotihY,$chr(41))
var %mokom $calc(%mokom + 14)
}
var %amplitodax $shorsim($gettok(%nishaB,3,32),$gettok(%nishaB,2,32),$gettok(%nishaB,1,32))
if ($gettok(%amplitodax,1,32) != 0) || ($gettok(%amplitodax,2,32) != 0) {
drawtext -rp @Page- $+ $1 $color(01) 3 %mokom Amplitoda X: x = %amplitodax
if ($gettok(%amplitodax,1,32)) kavmkovkv $1 x $v1
if ($gettok(%amplitodax,2,32)) kavmkovkv $1 x $v1
var %mokom $calc(%mokom + 14)
}
var %top1 $maxhazhka($2) , %top2 $maxhazhka($3)
if ($gettok(%top1,1,32) == $gettok(%top2,1,32)) {
var %s1 $gettok(%top1,2,32)
var %s2 $gettok(%top1,2,32)
var %x $calc(%s1 / %s2)
if (%x != 0) {
drawtext -rp @Page- $+ $1 $color(01) 3 85 Amplitoda Y: Y = %x
kavmkovkv $1 y %x
}
}
unset %nishaA , %nishab , %top1 , %top2
return 1
}
//DafHadash 1
alias DafHadash {
window -ac @Page- $+ $1 | window -p @Page- $+ $1
drawfill -r @Page- $+ $1 $color(00) $color(00) 0 0
drawline -r @Page- $+ $1 $color(01) 1 $calc($window(@Page- $+ $1).w / 2) 0 $calc($window(@Page- $+ $1).w / 2) $window(@Page- $+ $1).h
drawline -r @Page- $+ $1 $color(01) 1 0 $calc($window(@Page- $+ $1).h / 2) $window(@Page- $+ $1).w $calc($window(@Page- $+ $1).h / 2)
var %x 1 , %z $calc($window(@Page- $+ $1).w / 2) , %y $calc($window(@Page- $+ $1).w / 2)
var %z2 $calc($window(@Page- $+ $1).h / 2) , %y2 $calc($window(@Page- $+ $1).h / 2)
while (%x < 100) {
drawline -r @Page- $+ $1 $color(01) 1 %z $calc(($window(@Page- $+ $1).h / 2) + 5) %z $calc(($window(@Page- $+ $1).h / 2) - 5)
drawline -r @Page- $+ $1 $color(01) 1 %y $calc(($window(@Page- $+ $1).h / 2) + 5) %y $calc(($window(@Page- $+ $1).h / 2) - 5)
var %z $calc(%z + 8) , %y $calc(%y - 8)
drawline -r @Page- $+ $1 $color(01) 1 $calc(($window(@Page- $+ $1).w / 2) + 5) %z2 $calc(($window(@Page- $+ $1).w / 2) - 5) %z2
drawline -r @Page- $+ $1 $color(01) 1 $calc(($window(@Page- $+ $1).w / 2) + 5) %y2 $calc(($window(@Page- $+ $1).w / 2) - 5) %y2
var %z2 $calc(%z2 + 8) , %y2 $calc(%y2 - 8)
inc %x
}
}
//Skizha X^3 $chr(255) 1 - X^2
alias Skizha {
var %nishaA $makadmim($2)
var %nishaB $makadmim($3)
var %x -80
while (%x < 80) {
set %sum1 $azvetX(%nishaA,%x)
set %sum2 $azvetX(%nishaB,%x)
nkoda $1 $calc(%x * %distans) $calc((%sum1 / %sum2) * %distans)
unset %sum1 , %sum2
var %x $calc(%x + %jump)
}
}
$makadmim(x^2 + 2x -3) = -3 +2 1
alias makadmim {
var %x 1 , %top 0
while ($blokim($1-,%x)) {
var %v1 $v1
if (*x* iswm %v1) {
if ($gettok(%v1,2,$asc(^))) var %havka $v1
else var %havka 1
set %makadam $iif($remove($gettok(%v1,1,$asc(^)),x),$ifmatch,1)
set %makadam $iif(%makadam !isnum,$+(%makadam,1),%makadam)
var %z [ $+ [ %havka ] ] %makadam
inc %d3
unset %makadam
}
else var %z %v1
inc %x
}
var %x 1
while (%d3 > 0) {
if (%z [ $+ [ %x ] ]) dec %d3
var %d %d $iif(%z [ $+ [ %x ] ],$ifmatch,0)
inc %x
}
unset %d3
return $iif(%z,$ifmatch,0) %d
}
alias blokim {
var %x 1 , %y 0
while ($mid($1,%x,1) != $null) {
var %sd $asc($v1)
if ((%sd == 43) || (%sd == 45)) && (%x != 1) {
inc %y
if (%y == $2) {
var %tr %s5
unset %s5
return %tr
}
unset %s5
}
if (%sd != 32) set %s5 %s5 $+ $mid($1-,%x,1)
inc %x
}
inc %y
if (%y == $2) {
var %tr %s5
unset %s5
return %tr
}
unset %s5
if ($2 == 0) return %y
}
alias azvetX {
var %x 2
while ($gettok($1,%x,32) != $null) {
var %sumx $calc(%sumx + (($v1 * $2) ^ (%x - 1)))
inc %x
}
return $calc(%sumx + $gettok($1,1,32))
}
//nkoda Paga x y
alias nkoda {
var %x $calc(($window(@Page- $+ $1).w / 2) + $2)
var %y $calc(($window(@Page- $+ $1).h / 2) - $3)
drawline -r @Page- $+ $1 $color(01) 3 %x %y %x %y
}
$shorsim(a,b,c)
alias shorsim {
if (!$1) && (!$2) && (!$3) return $null
if (!$1) && (!$3) return 0
if (!$1) && (!$2) return $null
if (!$1) return $calc(($3 * -1) / $2 )
var %diskriminnta $calc(($2 ^ 2) -4 * $1 * $3)
if (%diskriminnta < 0) return $null
var %x1 $calc(((-1 * $2) + (%diskriminnta)^0.5)/(2 * $1))
var %x2 $calc(((-1 * $2) - (%diskriminnta)^0.5)/(2 * $1))
return %x1 %x2
}
alias maxhazhka {
var %nishaA $makadmim($1)
var %x $gettok(%nishaA,0,32)
while (%x) && (!%top) {
if ($gettok(%nishaA,%x,32) != 0) var %top $v1
dec %x
}
return %x %top
}
//kavmkovkv Page x/y 3
alias kavmkovkv {
if ($2 == x) {
var %x 1
while (%x < $window(@Page- $+ $1).h) {
drawline -r @Page- $+ $1 $color(01) 1.5 $calc(($3 * %distans) + ($window(@Page- $+ $1).w / 2)) %x $calc(($3 * %distans) + ($window(@Page- $+ $1).w / 2)) $calc(%x + 5)
var %x $calc(%x + 10)
}
}
else {
var %x 1
while (%x < $calc($window(@Page- $+ $1).w * 2)) {
drawline -r @Page- $+ $1 $color(01) 1.5 %x $calc(($3 * %distans * -1) + ($window(@Page- $+ $1).h / 2)) $calc(%x + 5) $calc(($3 * %distans * -1) + ($window(@Page- $+ $1).h / 2))
var %x $calc(%x + 10)
}
}
}
//adddlaf line text
alias adddlaf {
if ($1) {
if ($2 != —) did -o gc 1 $1 $remove($did(gc,1,$1).text,$chr(182),$chr(160),$chr(32),$chr(30)) $+ $2
else did -ro gc 1 $1 $3-
}
else {
if (%hilok) unset %hilok
did -r gc 1
set %fd 2 | set %mid 0
did -a gc 1 $chr(30)
did -a gc 1 $chr(30)
did -a gc 1 $chr(30)
}
}
on *:dialog:gc:*:*:{
if ($devent == init) { adddlaf | maverc | set %pages 1 | set %distans 10 | set %jump 0.01 }
if ($did(gc,1).sel == 0) set %text $did(gc,1,%fd)
else set %text $did(gc,1,$did(gc,1).sel)
set %text $remove(%text,$chr(182),$chr(160),$chr(32),$chr(30))
if ($devent == sclick) {
if ($did == 1) {
if (!%hilok) { did -c $dname 1 2 | set %fd 2 }
elseif ($did($dname,1).sel == 2) { did -c $dname 1 1 | set %fd 1 }
if (%hilok) && ($did($dname,1).sel != 2) set %mid $calc($len($did($dname,1,$v1).text) - 0)
set %fd $did($dname,1).sel
}
if ($did < 17) && ($did > 1) {
inc %mid
if (!%hilok) did -o gc 1 2 $left(%text,$calc(%mid - 1)) $+ $did($dname,$did).text $+ $right(%text,$iif(%mid == 1,$len(%text),$calc(%mid * -1 + 1))))
else {
if ($did(1).sel == 2) halt
if ($did(1).sel != 0) set %fd $v1
did -c $dname 1 %fd
did -o gc 1 %fd $left(%text,$calc(%mid - 1)) $+ $did($dname,$did).text $+ $right(%text,$iif(%mid == 1,$len(%text),$calc(%mid * -1 + 1))))
if ($len($did($dname,1,%fd).text) > $len($did($dname,1,$iif(%fd == 1,3,1)).text)) {
if (!$gettok($calc($len($did($dname,1,%fd).text) / 2),2,$asc(.))) did -o $dname 1 2 $did($dname,1,2).text $+ —
}
}
}
if ($did == 17) && (!%hilok) {
set %hilok 3
set %fd 3
adddlaf 1 $did($dname,1,2).text
did -o $dname 1 2 —— $+ $str(—,$len($right($did($dname,1,1).text,-4)))
did -c $dname 1 3
set %mid 0
}
if ($did == 18) {
if (!$did($dname,38)) { noop $input(You dont chst a Page!,ho) | halt }
var %v1 $remove($did($dname,1,1).text,$chr(182),$chr(160),$chr(32),$chr(30))
var %v2 $remove($did($dname,1,2).text,$chr(182),$chr(160),$chr(32),$chr(30))
var %v3 $remove($did($dname,1,3).text,$chr(182),$chr(160),$chr(32),$chr(30))
if ($did($dname,32).text isnum) set %distans $v1
if ($did($dname,34).text isnum) set %jump $v1
if (%hilok) {
if (%v1 != $null) && (%v3 != $null) {
noop $Garaf($gettok($did($dname,38).text,2,45),%v1,%v3)
halt
}
}
else {
if (%v2 != $null) {
noop $Garaf($gettok($did($dname,38).text,2,45),%v2,1)
halt
}
}
noop $input(You dont enter garef!,ho)
}
if ($did == 19) adddlaf
if ($did == 20) {
if (%mid < 1) halt
if (%mid == 1) did -o gc 1 %fd $right(%text,-1)
else did -o gc 1 %fd $left(%text,$calc(%mid - 1)) $right(%text,$iif(%mid == 1,$len(%text),$calc(%mid * -1))))
dec %mid
}
if ($did == 21) { .timermaverc off | maverc 1 - }
if ($did == 22) { .timermaverc off | maverc 1 + }
if (%hilok) {
if ($did == 24) && (%fd == 1) {
.timermaverc off
did -c $dname 1 $calc(%fd + 2)
did -o $dname 1 %fd $remove($did($dname,1,%fd).text,$chr(182),$chr(160),$chr(32),$chr(30))
if ($did($dname,1).sel != 2) set %mid $calc($len($did($dname,1,$did($dname,1).sel).text) - 0)
set %fd 3
maverc 1
}
if ($did == 25) && (%fd == 3) {
.timermaverc off
did -c $dname 1 $calc(%fd - 2)
did -o $dname 1 %fd $remove($did($dname,1,%fd).text,$chr(182),$chr(160),$chr(32),$chr(30))
if ($did($dname,1).sel != 2) set %mid $calc($len($did($dname,1,$did($dname,1).sel).text) - 0)
set %fd 1
maverc 1
}
}
if ($did == 29) {
DafHadash %pages
did -a $dname 38 Paga- $+ %pages
did -c $dname 38 %pages
inc %pages
}
if ($did == 30) {
if ($did($dname,38).sel != 0) {
window -c @Page- $+ $v1
did -dl gc 38 $v1
did -c $dname 38 1
}
}
if ($did == 35) {
adddlaf
did -ra $dname 32 10
did -ra $dname 34 0.01
}
if ($did == 39) {
var %x 1
while (%x <= %pages) {
if ($window(@page- $+ %x)) window -c @page- $+ %x
inc %x
}
set %pages 1
did -r $dname 38
}
}
if ($devent == close) { .timermaverc off | unset %hilok , %fd , %mid , %text , %pages , %distans , %jump }
}
alias saman {
if (!%hilok) { return 2 }
else {
if ($did(gc,1).sel) { set %fd $v1 | return $v1 }
else return %fd
}
}
alias maverc {
if ($did(gc,1).sel == 0) set %text $did(gc,1,%fd)
else set %text $did(gc,1,$did(gc,1).sel)
set %text $remove(%text,$chr(182),$chr(160),$chr(32),$chr(30))
if ($2 == +) && (%mid < $len(%text)) inc %mid
if ($2 == -) && (%mid > 0) dec %mid
did -o gc 1 $iif($did(gc,1).sel,$did(gc,1).sel,%fd) $left(%text,%mid) $iif($1 == 1,$+($chr(160),$chr(160)),$chr(182)) $right(%text,$iif(%mid == 0,$len(%text),$calc(%mid * -1))))
unset %text
.timermaverc -m 1 300 maverc $iif($1 == 1,2,1)
}
dialog gc {
title "Graphic Calculator 2.1"
size -1 -1 116 109
option dbu
list 1, 5 7 57 22, size
button "1", 2, 6 56 11 9
button "2", 3, 17 56 11 9
button "3", 4, 28 56 11 9
button "4", 5, 6 65 11 9
button "5", 6, 17 65 11 9
button "6", 7, 28 65 11 9
button "7", 8, 6 74 11 9
button "8", 9, 17 74 11 9
button "9", 10, 28 74 11 9
button ".", 11, 6 83 11 9
button "0", 12, 17 83 11 9
button "-", 13, 50 56 11 9
button "+", 14, 39 56 11 9
button "^", 15, 39 65 11 9
button "X", 16, 28 83 11 9
button "/", 17, 50 65 11 9
button "Enter", 18, 39 83 22 9
button "C", 19, 39 74 11 9
button "del", 20, 50 74 11 9
button "<", 21, 14 39 13 8
button ">", 22, 40 39 13 8
button "O", 23, 27 39 13 8, disable
button "v", 24, 27 47 13 8
button "^", 25, 27 31 13 8
box "", 26, 2 1 63 95
box "", 27, 64 1 50 51
box "", 28, 64 48 50 33
button "New page", 29, 67 20 44 9
button "Close page", 30, 67 30 44 9
text "Distancsed:", 31, 66 57 29 8
edit "10", 32, 94 55 18 10 begin_of_the_skype_highlighting 94 55 18 10 end_of_the_skype_highlighting begin_of_the_skype_highlighting 94 55 18 10 end_of_the_skype_highlighting begin_of_the_skype_highlighting 94 55 18 10 end_of_the_skype_highlighting begin_of_the_skype_highlighting 94 55 18 10 end_of_the_skype_highlighting
text "Jumps:", 33, 66 68 25 8
edit "0.01", 34, 94 66 18 10
button "Reset", 35, 68 83 19 10
button "Close", 36, 91 83 19 10 , cancel
box "", 37, 64 77 50 19
combo 38, 67 8 45 50, size drop
button "Close all pages", 39, 67 40 44 9
button "HELP", 40, 76 98 37 9
link "That code made by Vendetta.", 41, 3 98 72 8
}
menu * {
Graphic Calculator://dialog -mo gc gc
}
הערות , הקוד כתוב ממש ממש ממש ממש ממש רע בגלל שהחשק לכתוב אותו הלך לפחת אחרי כמה שעות XD וגם בכלל שלמדעתי תוך כדי הכתיבה איך עושים דברים מסוימים אז סורי XD . ניסיתי לכתוב אותו גם בצורה הכי ברור שאני מסוגל בשביל שאנשים אחרים יוכלו ללמוד מימנו דברים חדשים אז אממ יאללה תהנו