dahid84 5 Posted November 8, 2015 Report Share Posted November 8, 2015 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 72,7.10.2006,'@','Phoenix Coyotes','W',,2,1,2,0,0,'W 2',3 33,9.10.2006,,'St. Louis Blues','W',,2,0,3,0,0,'W 3',2 24,11.10.2006,,'New York Islanders','L','SO',4,5,3,0,1,'L 1',9 45,15.10.2006,,'Dallas Stars','L','SO',3,4,3,0,2,'L 2',7 46,18.10.2006,,'Detroit Red Wings','W',,4,1,4,0,2,'W 1',5 67,20.10.2006,,'Minnesota Wild','W',,2,1,5,0,2,'W 2',3 38,22.10.2006,'@','Los Angeles Kings','W','SO',3,2,6,0,2,'W 3',5 59,25.10.2006,,'Edmonton Oilers','W',,6,2,7,0,2,'W 4',8 810,27.10.2006,'@','Minnesota Wild','L','SO',2,3,7,0,3,'L 1',5 511,28.10.2006,'@','Chicago Blackhawks','W',,3,0,8,0,3,'W 1',3 312,30.10.2006,'@','St. Louis Blues','W','SO',6,5,9,0,3,'W 2',11 1113,1.11.2006,,'New York Rangers','L','OT',3,4,9,0,4,'L 1',7 714,3.11.2006,,'Phoenix Coyotes','W',,6,2,10,0,4,'W 1',8 815,6.11.2006,,'Pittsburgh Penguins','W','OT',3,2,11,0,4,'W 2',5 516,9.11.2006,'@','Vancouver Canucks','W',,6,0,12,0,4,'W 3',6 617,10.11.2006,'@','Calgary Flames','L',,0,3,12,1,4,'L 1',3 318,12.11.2006,,'Minnesota Wild','W',,3,2,13,1,4,'W 1',5 519,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 72,7.10.2006,'@','Phoenix Coyotes','W',,2,1,2,0,0,'W 2',3 33,9.10.2006,,'St. Louis Blues','W',,2,0,3,0,0,'W 3',2 24,11.10.2006,,'New York Islanders','L','SO',4,5,3,0,1,'L 1',9 45,15.10.2006,,'Dallas Stars','L','SO',3,4,3,0,2,'L 2',7 46,18.10.2006,,'Detroit Red Wings','W',,4,1,4,0,2,'W 1',5 67,20.10.2006,,'Minnesota Wild','W',,2,1,5,0,2,'W 2',3 38,22.10.2006,'@','Los Angeles Kings','W','SO',3,2,6,0,2,'W 3',5 59,25.10.2006,,'Edmonton Oilers','W',,6,2,7,0,2,'W 4',8 810,27.10.2006,'@','Minnesota Wild','L','SO',2,3,7,0,3,'L 1',5 6 and write in new list:2 -13 - 04- 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 { } } Quote Link to post Share on other sites
HelloInsomnia 1103 Posted November 8, 2015 Report Share Posted November 8, 2015 You can divide the number by 2 and then see if there is a decimal (a period) and if there is then you know that it is an odd number. Quote Link to post Share on other sites
pftg4 102 Posted November 8, 2015 Report Share Posted November 8, 2015 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 1 Quote Link to post Share on other sites
dahid84 5 Posted November 9, 2015 Author Report Share Posted November 9, 2015 thx 4 help Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.