Jump to content
UBot Underground

Problem With Comparison - Add Or Even


Recommended Posts

Hi i make big statistic list and i have problem how to solve problem with comparition.

 

Can you help me guys ? I dont have idea how to solve this problem

 

 

 

I have big list NHL statistic since 2000r ( who how many score goals ( add or even)

Example:

 

1,6.10.2006,,'Los Angeles Kings','W',,4,3,1,0,0,'W 1',7                                7
2,7.10.2006,'@','Phoenix Coyotes','W',,2,1,2,0,0,'W 2',3                              3
3,9.10.2006,,'St. Louis Blues','W',,2,0,3,0,0,'W 3',2                                      2
4,11.10.2006,,'New York Islanders','L','SO',4,5,3,0,1,'L 1',9                         4
5,15.10.2006,,'Dallas Stars','L','SO',3,4,3,0,2,'L 2',7                                      4
6,18.10.2006,,'Detroit Red Wings','W',,4,1,4,0,2,'W 1',5                                6
7,20.10.2006,,'Minnesota Wild','W',,2,1,5,0,2,'W 2',3                                      3
8,22.10.2006,'@','Los Angeles Kings','W','SO',3,2,6,0,2,'W 3',5                       5
9,25.10.2006,,'Edmonton Oilers','W',,6,2,7,0,2,'W 4',8                                     8
10,27.10.2006,'@','Minnesota Wild','L','SO',2,3,7,0,3,'L 1',5                              5
11,28.10.2006,'@','Chicago Blackhawks','W',,3,0,8,0,3,'W 1',3                        3
12,30.10.2006,'@','St. Louis Blues','W','SO',6,5,9,0,3,'W 2',11                          11
13,1.11.2006,,'New York Rangers','L','OT',3,4,9,0,4,'L 1',7                                    7
14,3.11.2006,,'Phoenix Coyotes','W',,6,2,10,0,4,'W 1',8                                       8
15,6.11.2006,,'Pittsburgh Penguins','W','OT',3,2,11,0,4,'W 2',5                                5
16,9.11.2006,'@','Vancouver Canucks','W',,6,0,12,0,4,'W 3',6                                     6
17,10.11.2006,'@','Calgary Flames','L',,0,3,12,1,4,'L 1',3                                       3
18,12.11.2006,,'Minnesota Wild','W',,3,2,13,1,4,'W 1',5                                             5
19,15.11.2006,,'Philadelphia Flyers','L',,4,7,13,2,4,'L 1',11                                      11

 

Like y see last number is a (add or even) a have write bot who check list and find 2 or more  even number one by one...

example

 

1,6.10.2006,,'Los Angeles Kings','W',,4,3,1,0,0,'W 1',7                                7
2,7.10.2006,'@','Phoenix Coyotes','W',,2,1,2,0,0,'W 2',3                              3
3,9.10.2006,,'St. Louis Blues','W',,2,0,3,0,0,'W 3',2                                      2
4,11.10.2006,,'New York Islanders','L','SO',4,5,3,0,1,'L 1',9                         4
5,15.10.2006,,'Dallas Stars','L','SO',3,4,3,0,2,'L 2',7                                      4
6,18.10.2006,,'Detroit Red Wings','W',,4,1,4,0,2,'W 1',5                                6
7,20.10.2006,,'Minnesota Wild','W',,2,1,5,0,2,'W 2',3                                      3
8,22.10.2006,'@','Los Angeles Kings','W','SO',3,2,6,0,2,'W 3',5                       5
9,25.10.2006,,'Edmonton Oilers','W',,6,2,7,0,2,'W 4',8                                     8
10,27.10.2006,'@','Minnesota Wild','L','SO',2,3,7,0,3,'L 1',5                              6
 
and write in new list:
2 -1
3 - 0
4- 1
 
do you have idea how to do this ?
Or ther is option in ubot to reconize even and add number ?
 
if($comparison(#number"=""EVEN")) {
        then {
            set(#even, 1, "Global")
        }
        else {
        }
    }

 

 

Link to post
Share on other sites
ui log view("Log")
purpose("to determine odd or even")
define $is even(#number) {
    activity("checking if number is present")
    establish("no number present ",$comparison(#number,"!= Does not equal",$nothing),"No") {
        alert("no numer to check")
        log("no number is present")
        stop script
    }
    activity("Taking number dividing by 2 ")
    set(#is even,$divide(#number,2),"Global")
    activity("checking for . (period) if is present it\'s odd")
    if($contains(#is even,".")) {
        then {
            return("is odd")
            log("returning odd")
        }
        else {
            return("is even")
            log("returning even")
        }
    }
}
alert($is even(36))

just alter the alert to what ever number you want

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...