Sealeopard
(KiX Master)
2003-05-23 08:59 PM
KiXgolf: MOAN - Mother Of All Networks

=============
The Challenge
=============


You are to create the Mother Of All Networks (MOAN) UDF. This UDF will provide certain network information depending on the parameters passed to it. The challenge will be run as a private coding challenge from Friday, May 23, 3pm EST to Friday, May 30, 3pm EST. A second public coding phase will start on Friday, May 30 and end on Wednesday, June 4, 3pm EST. The task is to generate the corresponding output based on the input of either two or three of the parameters IP Address, Network ID, and Subnet Mask. Specifics are provided in section "Inputs & Outputs".

A download is available at http://people.bu.edu/jenmeyer/kixtart/kixgolf_moan.zip

=============
Specification
=============


The Moan UDF has the following prototype
code:
Function MOAN($IP, $NetworkID, $SubnetMask)
EndFunction

All functionality of the UDF must be contained within the FUNCTION/ENDFUNCTION commands. You are not allowed to call code located outside the UDF. The subnet mask $SubnetMask can be either the traditional four-octets or the alternate CIDR number, e.g. 255.255.255.0 and 24. The parameters can contain up to two spaces between the decimal points and the number, e.g. 192.168.0.10 and 192.168.  0. 10 should be treated the same.

=============
Inputs & Outputs
=============

Assumtion: Network/broadcast addresses are not available as regular IP addresses though RFC3021 allows /31 networks (two IP addresses where the network/broadcast addresses are used as regular IP addresses)
  • Input: IP, NetworkID, Subnet Mask
    Output: 1 if the IP is a member of a nework defined by network ID and subnet mask, otherwise 0
  • Input: IP, NetworkID
    Output: Array of all potential subnet masks or empty string if no match
  • Input: IP, Subnet Mask
    Output: Network ID or empty string if no match
  • Input: NetworkID, Subnet Mask
    Output: Array of all potential IP addresses or empty string if no match
  • At least two input parameters must be provided
If the output consists of an array of IP addresses, then the IP addresses must be sorted in ascending order.
========
Example
=======

Input: IP=192.168.10.123,NetworkID=192.168.10.0,SubnetMask=255.255.255.192
Output: MOAN=1

Input: NetworkID=10.10.5.4,SubnetMask=255.255.255.252
Output: Moan[0]=10.10.5.5
Moan[1]=10.10.5.6

Input: IP=192.10.128.55, SubnetMask=27
Output: MOAN=192.10.128.32

=======
Scoring
=======


Your results will be compared with the solutions provided in the kixgolf_moan.ini. You must pass all tests in order to have a valid KiXgolf score.

=============
General rules
=============


  • The UDF must be written as one or more lines.
  • The UDF is expected to finish in a reasonable time, e.g. if it gets started when the challenge opens, it's expected to be finished by the time the challenge closes even on a somewhat slow computer. The UDF has to be valid during the period that the challenge runs.
  • You can submit scores as often as you want to until the deadline, no reason to wait until the last minute. In fact, other people want to see the score to beat. So don't be a spoilsport by hoarding your score. Submit early and often.
  • The UDF may only use the KiXtart commands/functions/macros, no other code fragments are allowed. COM-calls that are part part of a standard default Windows installation are allowed.
  • The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site.
  • You may assume ASCII as character set.
  • You are not allowed to use additional code that is external to the MOAN UDF. All code must be contained within the MOAN UDF.
When posting KiXtart Golf Scores, please include the KIXGOLF_MOAN.TXT file that is created in the script directory. It contains some basic information about the computer that the script is run on.
========
Deadline
========


Private coding starts Friday, May 23, 3pm EST
Private coding ends Friday, May 30, 3pm EST
Public coding start Friday, May 30, 3pm EST
Public coding ends Wednesday, June 4, 3pm EST

============
Test program
============


A test program is provided to help screen entries and to provide the Golf Score.
Any program that passes the test program can be submitted. If you are surprised that your solution passed the test program, please submit it anyway! That will help me identify bugs in the test program.

================================================================
KiXtart GOLF - How To Play
================================================================


Most importantly, anybody can play, no age restrictions, no penalties, no handicap!

The object in "real" golf is to hit the ball in the hole in the fewest strokes. The object in KiXtart Golf is to get from input (tee) to target (hole) in the fewest keystrokes.

Example: How many positive elements are in array $a?

Array $a could be of structure $a=[1, 2 ,-3, 4, -5, -7, 8, 9]

One approach:
code:
for $b=0 to ubound($a)
if $a[$b]>0
$c=$c+1
endif
next

for a score of 45.

Another solution is:
code:
DO
$b=$b+1
if $a[$b]>0
$c=$c+1
endif
UNTIL $b>(UBOUND($a)+1)

for a score of 53.

Better approach: Code sample 1

================================================================
KiXtart GOLF - The Rules
================================================================


1) The goal of KiXtart Golf is to score the lowest strokes.

2) Strokes are all characters in a piece of code except whitespace characters, unless the whitespace character is necessary for the line of code to work. Therefore, carriage returns and line feeds do not count or spaces in between the '=' sign when assigning variables, e.g. '$a = $b' scores 5.

3) Code can be constructed any way you like, as long as it is syntactically correct with KiXtart.

4) The final solution MUST pass all test scripts that accompagny the KiXtart golf challenge.

5) The use of '$' as a variable is allowed.

6) In case of questions about a particular way to count the KiXtart Golf Challenge organizer has the last call.

7) During the private coding phase, no code is allowed to be posted. Violations result in disqualification of said player.

8) During the public coding phase, code should be posted, reused, and borrowed from other players.

9) The following script can be used to count the KiXtart Golf score: http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003608

================================================================
KiXtart GOLF - The Duration of the Competition
================================================================


1) Private coding phase: From date/time of posting the tournament challenge to the following Friday, 3pm EST (BBS+6 time)

2) Public coding phase: From Friday, 3pm EST (BBS+6 time) to the following Wednesday, 3pm EST (BBS+6 time)

3) Final results: Wednesday, 3pm EST (BBS+6 time)

You will need the complete package from http://people.bu.edu/jenmeyer/kixtart/kixgolf_moan.zip.

[ 25. May 2003, 18:58: Message edited by: sealeopard ]


Howard Bullock
(KiX Supporter)
2003-05-23 09:10 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jens, just to be clear...
quote:
The UDF may only use the KiXtart commands/functions/macros, no other code fragments are allowed.
Does this prohibit the use of COM?


Sealeopard
(KiX Master)
2003-05-23 09:16 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Yes, calls to external COM functions (if part of a standard Windows install) are allowed. However, you cannot use custom COM functions or other external programs that are not part of a standard Windows installation.

LonkeroAdministrator
(KiX Master Guru)
2003-05-23 11:28 PM
Re: KiXgolf: MOAN - Mother Of All Networks

came back home...
seems like I have to study some network stuff as this is like hebrew to me.


Sealeopard
(KiX Master)
2003-05-23 11:40 PM
Re: KiXgolf: MOAN - Mother Of All Networks

You can always take a peek at the existing network UDFs.

LonkeroAdministrator
(KiX Master Guru)
2003-05-23 11:43 PM
Re: KiXgolf: MOAN - Mother Of All Networks

have tried that before [Big Grin]

can't understand even one line they include [Razz]


Howard Bullock
(KiX Supporter)
2003-05-23 11:46 PM
Re: KiXgolf: MOAN - Mother Of All Networks

If Lonk can't understand, then I have a chance [Big Grin]

[ 23. May 2003, 23:46: Message edited by: Howard Bullock ]


Chris S.
(MM club member)
2003-05-23 11:52 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jens, I thought you sais this one wouldn't include any math?

Well, looks like another outing where I won't even make the cut. [Wink]


LonkeroAdministrator
(KiX Master Guru)
2003-05-23 11:54 PM
Re: KiXgolf: MOAN - Mother Of All Networks

doh, it was same thing with last golf and I didn't produce any competitive code in the first round...

so, will see.

anyway...

you have almost all cases in your examples, but...
is this correct:
quote:

Input: IP=10.10.5.4,NetworkID=10.10.5.5
Output:
Moan[0]=2
Moan[1]=255.255.255.5
...
Moan[250]=255.255.255.253

have hard time understanding the subnet mask thing as I'm not network admin...
just a damn coder [Wink]


LonkeroAdministrator
(KiX Master Guru)
2003-05-24 12:04 AM
Re: KiXgolf: MOAN - Mother Of All Networks

to clarify my wonder, I have no clue how subnet is calculated.

I thought it had some logic but according to logic with input like:
Input: IP=192.10.128.55, Subnet=27

the output should be array...


LonkeroAdministrator
(KiX Master Guru)
2003-05-24 12:16 AM
Re: KiXgolf: MOAN - Mother Of All Networks

if someone else has trouble with this golf:
http://itresources.brainbuzz.com/techlibrary/gethtml.asp?ID=520

it's pretty simple explanation and easiest I found.
still have no understanding about the logic of the calculation and thus decide to leave this golf round...

at least for now.


Howard Bullock
(KiX Supporter)
2003-05-24 12:38 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Lonk. Come on... Read CalcLogicalSubnet()

You break the address into octets (4 x 1 byte (4 sets of 8 bits))
1.2.3.4 =
1
2
3
4

Subnet mask is 255.255.255.0
255
255
255
0

Now logical bitwise operations on each octet pair
1&255 = 1
2&255 = 2
3&255 = 3
4&0 = 0

[ 24. May 2003, 00:39: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-24 12:44 AM
Re: KiXgolf: MOAN - Mother Of All Networks

and the result is?
mm...
is it like not match as the last is 0?

does this mean...
no, it just means that we will on next friday.

have a good week.
(just like on last course)


Howard Bullock
(KiX Supporter)
2003-05-24 12:51 AM
Re: KiXgolf: MOAN - Mother Of All Networks

The logical subnet is 1.2.3.0

The ip address 1.2.3.4 is on logical subnet 1.2.3.0

if the mask was 255.255.255.128

Ip 1.2.3.4 is on subnet 1.2.3.0

IP 1.2.3.150 is on subnet 1.2.3.128

just bitwise and each number together 1&255, 2&255, 3&255, 150&128


LonkeroAdministrator
(KiX Master Guru)
2003-05-24 01:18 AM
Re: KiXgolf: MOAN - Mother Of All Networks

k, may think this over tomorrow.
tonight, seems that have no clue still...
so maybe after 1 slept night have some idea what is going and can start thinking how the code design will look...

anyway, you know that you will meet your enemy in the second round, so just code and keep on praying that you yourself know what you are doing [Big Grin]

btw, wonder where the old golf-fanatics are...

like, haven't heard anything about them except that they are expecting the golf (just they did with the previous one)...


Sealeopard
(KiX Master)
2003-05-24 03:19 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Chris: I stand by my statement, there is no math involved, just bit-manipulations [Big Grin]

Howard Bullock
(KiX Supporter)
2003-05-24 03:41 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jens, would your terminology be a little clearer if you changed the input term "Subnet" to "Subnet Mask" or just "Mask"?

Sealeopard
(KiX Master)
2003-05-24 06:32 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Howard: Thanks for the suggestion, I will change the terms to Subnet Mask. The ZIP package and the first post in this thread have now been updated to reference Subnet Masks.

Jooel: It all comes down to simple AND/OR binary calculations. Your Example:
code:
    IP         192. 10.128. 55
AND
SubnetMask 255.255.255. 0
=
NetworkID 192. 10.128. 0

See for example http://www.telusplanet.net/public/sparkman/netcalc.htm which allows to to enter IP addresses, network IDs, and subnet masks and then explains the results.

[ 24. May 2003, 23:19: Message edited by: sealeopard ]


Howard Bullock
(KiX Supporter)
2003-05-24 09:06 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jens, PM for you.

LonkeroAdministrator
(KiX Master Guru)
2003-05-24 09:30 PM
Re: KiXgolf: MOAN - Mother Of All Networks

jens, that calculator gave different result than you.

neither your example did have nothing to my question.
my question was what if network was this and IP that.
well, maybe you skipped it because hoby explained it...

but anyway, your result: NetworkID 192. 10.255. 0

is quite different from: NetworkID 192.10.128.0


Howard Bullock
(KiX Supporter)
2003-05-24 09:33 PM
Re: KiXgolf: MOAN - Mother Of All Networks

The spaces in Jens example are most likely so that @IPaddressx could be used. You will need to ignore/remove them for calculations.

LonkeroAdministrator
(KiX Master Guru)
2003-05-24 10:36 PM
Re: KiXgolf: MOAN - Mother Of All Networks

hoby, I'm not sure about to whom you answered.
spaces have nothing to do with difficulty.

if you were answering to me, I said that jens' answer is quite different than the one that common-sense gives.
wonder if this is the normal way in networking...


Howard Bullock
(KiX Supporter)
2003-05-24 10:40 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I must have misunderstood your spaces statement.

A couple errors exist. I have PM'ed Jens regarding a coding issue and Test #3.


Richie19Rich77
(Seasoned Scripter)
2003-05-24 10:58 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Lonkero is right

IP 192.010.128.055
SubnetMask 255.255.255.000

Network ID Should be:

NetworkID 192.010.128.000

Easy conversion into binary.

3rd Otect on Subnet Mask
128,64,32,16,8,4,2,1
1,1,1,1,1,1,1,1

Network ID
1,0,0,0,0,0,0,0 = 128

Now say the 4th Octec of the Subnet Mask was 128

1 ,0 ,0 ,0 ,0,0,0,0

Network ID would be.
0 ,1 ,1 ,1 ,1,1,1,1 = 127

You should start SuperNetting the Network Address, and that would make it fun. [Big Grin]

Rich

[ 24. May 2003, 23:00: Message edited by: Richard Farthing ]


Sealeopard
(KiX Master)
2003-05-24 11:20 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I'll double-check my test file for correct results tomorrow morning. I corrected the example in my last post.

I have to run now, got tickets for The Matrix: Reloaded!


Howard Bullock
(KiX Supporter)
2003-05-25 02:25 AM
Re: KiXgolf: MOAN - Mother Of All Networks

I would NOT claim this is OFFICIAL yet since I had to alter your code and test file. I will post the results again once you look at the issues I raised and post new test code. If you find I made the mistakes then I will retract this post.
code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/24 20:28:31.739
Processing End = 2003/05/24 20:28:31.839
Duration = 0000/00/00 00:00:00.100
# Loops = 1
KiXGolf Result = passed (6 out of 6 correct)
KiXGolf Score = 1460

code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/24 20:39:43.211
Processing End = 2003/05/24 20:39:43.292
Duration = 0000/00/00 00:00:00.081
# Loops = 1
KiXGolf Result = passed (6 out of 6 correct)
KiXGolf Score = 1154

code:
KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/24 21:06:50.395
Processing End = 2003/05/24 21:06:50.475
Duration = 0000/00/00 00:00:00.080
# Loops = 1
KiXGolf Result = passed (6 out of 6 correct)
KiXGolf Score = 884

code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/25 00:20:56.103
Processing End = 2003/05/25 00:20:56.183
Duration = 0000/00/00 00:00:00.079
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 814



[ 25. May 2003, 06:18: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-25 08:19 AM
Re: KiXgolf: MOAN - Mother Of All Networks

k, have read that cramsession talk and it confused the heck out of me.
damn, the talker must have been drunk when he wrote it as there is no red line anywhere.

still don't know (as asked about 30 hours ago) how to calc subnet when input is netID and IP.

still searching for some teaching article...


masken
(MM club member)
2003-05-25 01:21 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Lonkero, take a look at this article by Cisco:

http://www.cisco.com/warp/public/701/3.html


Sealeopard
(KiX Master)
2003-05-25 03:19 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Howard: I got your PM and will implement them. However, I won't be able to post then corrected scoring part until about 1pm EST due to some other committments.

The corrections look fine, however, and I'm sorry that I misused you guys as "beta-testers". Should have spend more time on the scoring engine instead of developing my own solution [Wink]


Howard Bullock
(KiX Supporter)
2003-05-25 03:26 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I found it to be part of the fun.

LonkeroAdministrator
(KiX Master Guru)
2003-05-25 03:42 PM
Re: KiXgolf: MOAN - Mother Of All Networks

mmm...
jens, your prototype looks ok but what I must ask is...
doh, as the input is optional, should the arguments be declared as "optional" or do we expect that it's called with "" or 0 if not input?


Sealeopard
(KiX Master)
2003-05-25 07:04 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jooel: Though some of the inputs might be optional for the purpose of this tournament the inputs will be provided nonetheless as empty strings.

Everybody: I've updated the test script and corrected one mistake in test 3, as I provided an incorrect NetworkID. The updated package can be downloaded at http://people.bu.edu/jenmeyer/kixtart/kixgolf_moan.zip

Kudos to Howard who found the mistakes. It should all work now.

I also added a clarification with regards to the use of /31 subnets. Though RFC3021 allows /31 networks (two IP addresses where the network/broadcast addresses are used as regular IP addresses), they are not considered valiud IP addresses with regards to this tournament. Thus, a /31 network only consistes of a Network ID and a broadcast address but no usable IP addresses. However, I do not see this as a shortcoming as the /31 is a special case that should only happen in very controlled network environments.


Howard Bullock
(KiX Supporter)
2003-05-25 07:12 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Official with the latest Jen's code [Big Grin]
code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/25 13:13:52.517
Processing End = 2003/05/25 13:13:52.597
Duration = 0000/00/00 00:00:00.080
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 801

Thank you for participating in KiXtart Golf!



LonkeroAdministrator
(KiX Master Guru)
2003-05-25 09:13 PM
Re: KiXgolf: MOAN - Mother Of All Networks

mm...
what about this (think I asked it already on the first page)...
I quess I somehow understand the calculation already, but.
quote:
;Input: IP, NetworkID
;Output: Array of all potential subnet masks or empty string if no match

is that like we can return the masks in the format we prefer?


LonkeroAdministrator
(KiX Master Guru)
2003-05-25 09:26 PM
Re: KiXgolf: MOAN - Mother Of All Networks

hehee...
was already getting mad as my answer was said to be incorrect...

but your new check-code proved the old wrong [Wink]
k, now have only about half of the code to code and am under 1500 strokes still!


LonkeroAdministrator
(KiX Master Guru)
2003-05-25 09:33 PM
Re: KiXgolf: MOAN - Mother Of All Networks

update.
am I correct when I say that there is no check code of calculating the possible subnets?


Howard Bullock
(KiX Supporter)
2003-05-25 10:37 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Yes you are correct that that case is not checked so I commented out my code for that option(rightly or wrongly).

LonkeroAdministrator
(KiX Master Guru)
2003-05-25 10:46 PM
Re: KiXgolf: MOAN - Mother Of All Networks

k, then next question.

is is possible to have networkID of 0.0.0.0?


Howard Bullock
(KiX Supporter)
2003-05-25 11:18 PM
Re: KiXgolf: MOAN - Mother Of All Networks

KiXGolf Score = 774 [Big Grin]

Sealeopard
(KiX Master)
2003-05-26 12:00 AM
Re: KiXgolf: MOAN - Mother Of All Networks

The sorting order for all outputs is covered
quote:
If the output consists of an array of IP addresses, then the IP addresses must be sorted in ascending order
This would also apply to network IDs and subnet masks.


Howard Bullock
(KiX Supporter)
2003-05-26 12:15 AM
Re: KiXgolf: MOAN - Mother Of All Networks

code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/25 18:20:06.971
Processing End = 2003/05/25 18:20:07.051
Duration = 0000/00/00 00:00:00.080
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 756



Sealeopard
(KiX Master)
2003-05-26 12:20 AM
Re: KiXgolf: MOAN - Mother Of All Networks

IM-ing with Jooel right now, he's a little bit frustrated.

Nice score, Howard.


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 12:53 AM
Re: KiXgolf: MOAN - Mother Of All Networks

k, as you hoby got that working...
maybe you could make your kixgolf-counter close the file [Big Grin]

damn, hate to have the udf-file locked up [Razz]


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 01:45 AM
Re: KiXgolf: MOAN - Mother Of All Networks

jens?
sleeping?

should the UDF be able to calculate class-A subnets?
getting little fuzzy when going beyond string length limit...


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 02:32 AM
Re: KiXgolf: MOAN - Mother Of All Networks

ping pong!
have doubled my code size with this.


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 03:22 AM
Re: KiXgolf: MOAN - Mother Of All Networks

k, think I got myself around this.
well, at least found a way to save some strokes...


Howard Bullock
(KiX Supporter)
2003-05-26 05:08 AM
Re: KiXgolf: MOAN - Mother Of All Networks

code:
KiXtart Golf Score
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/25 23:25:14.018
Processing End = 2003/05/25 23:25:14.048
Duration = 0000/00/00 00:00:00.029
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 695



[ 26. May 2003, 05:20: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 11:11 AM
Re: KiXgolf: MOAN - Mother Of All Networks

k, as got no answer...
this udf works only with class-c
thus it also passes the tests [Big Grin]

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/26 12:17:57.930
Processing End = 2003/05/26 12:18:00.233
Duration = 0000/00/00 00:00:02.302
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 861

Thank you for participating in KiXtart Golf!



Howard Bullock
(KiX Supporter)
2003-05-26 02:26 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Great going Joeel. [Big Grin]

My first score was 1460. It looks like you might be on your way to catching me.

Current:KiXGolf Score = 667


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 02:30 PM
Re: KiXgolf: MOAN - Mother Of All Networks

well, as the rules are rather "undefined" here can't celebrate too much.

and as there is no check for that one case, can't know for sure that my UDF is bulletproof.

and as can't know, can't really start reducing the score as it's messy enough now too to start changing if needed (rules clarified)

[edit]
btw hoby, how come your sig says that you use 4.12 and golf summary says 4.21?
time to update the signature maybe?

[ 26. May 2003, 14:32: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2003-05-26 03:44 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I have many versions on my computer that I use for testing. Version 4.02 is what I use in production at work.

And 4.21 is what I using for the current KixGolf outing.

And you distributed WKix32 (version 4.12) with the version of bbChecker I am using...hence the 4.12 in my signature line.

[ 26. May 2003, 16:23: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-26 03:49 PM
Re: KiXgolf: MOAN - Mother Of All Networks

and once again it comes back to historical bbChecker [Wink]

Sealeopard
(KiX Master)
2003-05-26 05:46 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Jooel: A Class-A network is definitely overkill with regards to testing in case of returning the valid IPs. However, testing whether an IP address is part of a Class-A network should not create any problem.

Also, I do not test for every possible return, thus you definitely won't have me check whether it atually returns all 32000+ possible IP addresses for a 255.255.0.0 subnet, but your code should be able to handle it, anyway.

I can always decide later on to add some tests to it [Wink]


Howard Bullock
(KiX Supporter)
2003-05-26 05:47 PM
Re: KiXgolf: MOAN - Mother Of All Networks

It is getting harder to reduce the number of strokes. Without some structure change I think I am getting close to the end.

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/26 11:37:37.416
Processing End = 2003/05/26 11:37:37.436
Duration = 0000/00/00 00:00:00.020
# Loops = 1
KiXGolf Result = passed (7 out of 7 correct)
KiXGolf Score = 661

Thank you for participating in KiXtart Golf!



MightyR1
(MM club member)
2003-05-26 09:18 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Nice Challenge!!! And usefull too.

Crunching my brains over it...
Will first read tutorials like Lonk did [Wink]

WIll report back later...


Sealeopard
(KiX Master)
2003-05-26 09:50 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Folks:

After talking with Jooel, I'd like to clarify one thing. Following is a quote from IM:
quote:
Okay, I doublechecked wordings. In 10.10.10.0/24 the /24 is defined as the subnet mask when using CIDR. Thus, according to the current KiXgolf rules, an output of /24 as a subnet mask would be permissable.


Howard Bullock
(KiX Supporter)
2003-05-26 10:46 PM
Re: KiXgolf: MOAN - Mother Of All Networks

What about the section about return an array of masks for a given IP and networkID? No test...do we need to code it to pass?

If no, I like my 661...If yes, well crap.


Sealeopard
(KiX Master)
2003-05-26 10:49 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Yes, you do need to code it as it is a requirement. Just because I'm currently not testing for it, doesn't mean you can just drop that part.

Jooel already requested additional tests.


Howard Bullock
(KiX Supporter)
2003-05-26 10:53 PM
Re: KiXgolf: MOAN - Mother Of All Networks

My post to date are then NULL and void because the code does not satisfy the requirements.

[Frown]

Back the coding I guess.


Sealeopard
(KiX Master)
2003-05-26 11:17 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I've added two more tests to the KiXgolf validation. They will test the case where potential subnet masks need to be returned and accepts both octet- and CIDR-style subnet masks as potential answers.

Download the updated package here: http://people.bu.edu/jenmeyer/kixtart/kixgolf_moan.zip


LonkeroAdministrator
(KiX Master Guru)
2003-05-27 12:00 AM
Re: KiXgolf: MOAN - Mother Of All Networks

yeah, now we are talking:
quote:
KiXGolf Result = failed (6 out of 9 correct)
rock'n roll!
quess we are all back to square 6? [Razz]


Sealeopard
(KiX Master)
2003-05-27 12:01 AM
Re: KiXgolf: MOAN - Mother Of All Networks

But I added only tow new tests? And you show three failing, thus you still had some work to do even before I added the two additional tests [Big Grin]

[ 27. May 2003, 21:17: Message edited by: sealeopard ]


Howard Bullock
(KiX Supporter)
2003-05-27 03:37 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Jens, I think you missed a subnet mask that makes TEST #8 true.

255.255.254.0 (/23) is also valid from what my code says. If you agree, then I have working code again.

code:
IP Address         = 10.10.10.2
Network ID = 10.10.10.0
Subnet Mask =
Correct Answer =
Alternative Answer = /24,/25,/26,/27,/28,/29,/30
Your Answer = /23,/24,/25,/26,/27,/28,/29,/30
Your answer is incorrect

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 848 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/26 21:33:00.937
Processing End = 2003/05/26 21:33:01.017
Duration = 0000/00/00 00:00:00.080
# Loops = 1
KiXGolf Result = failed (8 out of 9 correct)
KiXGolf Score = 868



[ 27. May 2003, 03:37: Message edited by: Howard Bullock ]


MightyR1
(MM club member)
2003-05-27 07:24 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Could we have a test for a subnetted class B too???

LonkeroAdministrator
(KiX Master Guru)
2003-05-27 09:16 AM
Re: KiXgolf: MOAN - Mother Of All Networks

hoby, I started thinking the same thing...

then I came to the conclusion that there is actually more.
and then decided to go to bed [Big Grin]

why 255.255.252.0 would not be ok, dunno...

maybe there is this thing that 10 (as starting address) is impossible.


Howard Bullock
(KiX Supporter)
2003-05-27 01:05 PM
Re: KiXgolf: MOAN - Mother Of All Networks

(10 & 252) equals 8 not 10 so 255.255.252.0 does not work as it changes the NetworkID.

I checked all possible subet mask values from at 8 bits to 31 bits and only the ones I list seem to be valid.

[ 27. May 2003, 13:09: Message edited by: Howard Bullock ]


Howard Bullock
(KiX Supporter)
2003-05-27 01:26 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Hey! Time for a rollcall. Who is working on this KiXgolf problem beside Lonkero and me?

We seem to be the only takers here.


MightyR1
(MM club member)
2003-05-27 01:48 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Me am Playing Golf too!!!

Damn those class A/B subnets. Can't get the subnetmask/ip-addresses to work... [Mad] [Mad]

Score for determining in-IPrange & NetWorkID = 530


MightyR1
(MM club member)
2003-05-27 01:50 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Need an example / result list of determining the possible subnets for a class A/B subnet...

Anyone???


LonkeroAdministrator
(KiX Master Guru)
2003-05-27 01:53 PM
Re: KiXgolf: MOAN - Mother Of All Networks

pat, that's about the score I had there too [Wink]

hoby, I must wonder...
if jens disabled that one as that 254 has only broadcast and network-id and thus the IP can't be there.

damn, this goes tricky... too tricky.

like jens already pointed out, my code broke more when tried to get this piece to work.
I think I'm gonna do total re-write... at least try as that method I figured when woke up and in the buss... it seems like zillion times shorter...
can't know though...


LonkeroAdministrator
(KiX Master Guru)
2003-05-27 01:55 PM
Re: KiXgolf: MOAN - Mother Of All Networks

pat, I could write you a code that generates them but that would be too big part of the golf-solution [Wink]

MightyR1
(MM club member)
2003-05-27 02:25 PM
Re: KiXgolf: MOAN - Mother Of All Networks

K, do NOT send!!!

Spoils the fun [Big Grin]


Richard H.Administrator
(KiX Supporter)
2003-05-27 03:16 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Howard, your calculations are correct.

IP address 10.10.10.2 and mask 255.255.254.0 would give you:
Subnet address: 10.10.10.0
Broadcast address: 10.10.11.255

All addresses in between are valid IP addresses, including 10.10.10.255 and 10.10.11.0

Jens, one question occurs to me. I can't see in the instructions where you are limiting the scope of the masks, so for a network of "10.10.10.0" you could apply a netmask of "10.10.10.255", which would be valid and give you a range of 168,430,336 potential addresses.

I assume that you are only using masks with contiguous bits.


Howard Bullock
(KiX Supporter)
2003-05-27 04:24 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I assumed continous valid subnet mask of 8 through 31 bits starting from the high order side (progressing from left to right).

[ 27. May 2003, 16:27: Message edited by: Howard Bullock ]


Sealeopard
(KiX Master)
2003-05-27 09:31 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Just to make it official, test 8 does have 255.255.254.0 or /23 as correct solution.

I've updated the .INI file accordingly. Download the package at http://people.bu.edu/jenmeyer/kixtart/kixgolf_moan.zip

quote:
I assume that you are only using masks with contiguous bits
Yes, that's correct. I believe you actually have to use contiguous bits as this is how CIDR is defined. See for example http://www.cisco.com/warp/public/701/3.html#cidr

I've also covered the 255.255.255.254 or /31 case where you only have two IP addresses, namely the network ID and the broadcast address. Quote from the rules in the Input&Output section:
quote:
Assumtion: Network/broadcast addresses are not available as regular IP addresses though RFC3021 allows /31 networks (two IP addresses where the network/broadcast addresses are used as regular IP addresses)



[ 27. May 2003, 21:40: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-27 09:34 PM
Re: KiXgolf: MOAN - Mother Of All Networks

although, both cases can make the logic harder or easier, depending of the logic used.

Howard Bullock
(KiX Supporter)
2003-05-27 10:20 PM
Re: KiXgolf: MOAN - Mother Of All Networks

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 698 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/27 16:24:55.287
Processing End = 2003/05/27 16:24:55.387
Duration = 0000/00/00 00:00:00.100
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 863

Thank you for participating in KiXtart Golf!



Howard Bullock
(KiX Supporter)
2003-05-28 03:09 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Ok Pat. Why are we not hearing anything from you?

MightyR1
(MM club member)
2003-05-28 08:15 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Rumble Flumble Stumble

Am here... Digging into my TCP/IP documentation.

Discovered my approach is a nogo for the subnets/ip-addresses... Must make redesign [Frown]


LonkeroAdministrator
(KiX Master Guru)
2003-05-28 08:54 AM
Re: KiXgolf: MOAN - Mother Of All Networks

alright!
good to hear that I'm not only mixing ideas and codes [Wink]

think I need to do something to my script as only the isinsubnet-part (all parameters provided) is ready and it already has:
Duration = 0000/00/00 01:49:34.804


MightyR1
(MM club member)
2003-05-28 08:59 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Hmmm...

That part is a bit faster in my version:

code:
KiXtart
KiXtart Version = 4.20
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 730 MHz
Memory = 382 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/28 09:05:27.533
Processing End = 2003/05/28 09:05:27.627
Duration = 0000/00/00 00:00:00.094
# Loops = 1
KiXGolf Result = failed (6 out of 9 correct)
KiXGolf Score = 538

Thank you for participating in KiXtart Golf!



Richard H.Administrator
(KiX Supporter)
2003-05-28 09:29 AM
Re: KiXgolf: MOAN - Mother Of All Networks

quote:
Yes, that's correct. I believe you actually have to use contiguous bits as this is how CIDR is defined.
Just wanted to clarify, as the rules stated that "old style 4 octet" representation was acceptable, which of course allows for non-contiguous bit masks.

[ 28. May 2003, 09:30: Message edited by: Richard H. ]


Howard Bullock
(KiX Supporter)
2003-05-29 12:55 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Pat, you must be using the same approach I did to have that speed. Lonk likes brute force so that he can take a cat nap while testing. [Wink]

Just as long as you add 330 strokes to get the last tests complete I'll be happy. [Big Grin]

[ 28. May 2003, 12:56: Message edited by: Howard Bullock ]


MightyR1
(MM club member)
2003-05-28 02:47 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Scribbling on paper now... Got a new approach...

330 strokes??? Hmmm... Guess it will be more [Mad]


LonkeroAdministrator
(KiX Master Guru)
2003-05-28 03:21 PM
Re: KiXgolf: MOAN - Mother Of All Networks

paper could be smart...
I added some logic to mine to make it more speedy.
well, it seems to take even more time...
it was like 2hours and now seems to be 3hours.


Sealeopard
(KiX Master)
2003-05-28 03:25 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Richard: Yes, four-octet representation is allowed, too. I've checked RFC950, which defines subnet masks. It does state
quote:
subnet bits need not be contiguous
However, I have yet to see a non-contigous subnetmask used at all, I can't even find examples or why it sould/should not be used. See http://rfc.net/rfc950.html for details. Thus, with regards to this KiXgolf subnet masks will consist of contiguous bits.


Howard Bullock
(KiX Supporter)
2003-05-28 03:29 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Thank you thank you!! [Big Grin] \

Richard, you trying to give me an ulcer? [Wink]


Richard H.Administrator
(KiX Supporter)
2003-05-28 03:42 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Heh heh [Wink]

I dimly recall a theoretical use for non contiguous netmasks for improving routing solutions, but to be honest I don't know of any installation in practice.

I think that most modern routing protocols abhor them too.

Jus' playin' Devils Advocate. ];/p


Sealeopard
(KiX Master)
2003-05-28 03:46 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Now that you've confessed to be very familiar with subnetting, I do have to ask: Where's your KiXgolf code? [Wink]

Richard H.Administrator
(KiX Supporter)
2003-05-28 03:53 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Sadly due to timezones and public holidays I didn't get to see the challenge 'till yesterday, and workload means I won't get an opportunity to participate.

Besides, it's far more fun worrying Howard.


Howard Bullock
(KiX Supporter)
2003-05-28 04:20 PM
Re: KiXgolf: MOAN - Mother Of All Networks

This is making me nervous. Am I the only one with working code? Or is someone out there sitting with code and a better score waiting for Friday to post it? [Confused]

Sealeopard
(KiX Master)
2003-05-28 04:26 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Joeel has code but his take 3 hours to complete, thus he can only change one thing and has to wait another three hours to see whether it works. [Big Grin]

LonkeroAdministrator
(KiX Master Guru)
2003-05-28 07:01 PM
Re: KiXgolf: MOAN - Mother Of All Networks

why shouldn't it work [Wink]

jens is right but will see...
have my drinks later on so will have such a burst in brainpower that might have awesome score today...

problem is that subnetmask of 254 makes problems with my new method.

so will probably end up with even longer code than the one before had.


MightyR1
(MM club member)
2003-05-28 08:31 PM
Re: KiXgolf: MOAN - Mother Of All Networks

No working code yet...

Still fighting with IP's and subnets...


Howard Bullock
(KiX Supporter)
2003-05-28 08:38 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Come on guys, you are starting to make my head swell. [Big Grin]

No competition it seems. [Cool]

[ 28. May 2003, 20:38: Message edited by: Howard Bullock ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-28 09:05 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I'm still unable to compete.
I can make up a code but once it goes over 1000 I rather skip it.


Chris S.
(MM club member)
2003-05-28 11:41 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I'd compete, but I started getting migranes looking at this crap on Saturday. [Roll Eyes] [Razz] [Wink]

[ 28. May 2003, 23:41: Message edited by: Chris S. ]


Sealeopard
(KiX Master)
2003-05-29 02:08 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Come on guys, there's not even real math involved.

Sealeopard
(KiX Master)
2003-05-29 03:28 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Howard: I've started coding! 1500 strokes with no variable optimization and five correct tests.

And to start getting some more people interested, here's an interesting way to generate a consecutive number of zeros or ones. In my case I was looking for a way to generate 32 consecutive 0s as a string.
code:
 $zeros=substr(formatnumber(0,32),3)
$ones=substr(formatnumber(1.0/9,16),3)
$ones=$ones+$ones



[ 29. May 2003, 03:30: Message edited by: sealeopard ]


Sealeopard
(KiX Master)
2003-05-29 04:56 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Ahh, getting there, 1769 with 7 of 9 correct. Will work onthe last two tomorrow evening, just the IP address arrays left and then the cleanup.

[ 29. May 2003, 04:58: Message edited by: sealeopard ]


LonkeroAdministrator
(KiX Master Guru)
2003-05-29 06:10 PM
Re: KiXgolf: MOAN - Mother Of All Networks

think that you guys started from different angle.
I got 5/9 with just 300 strokes but getting more doubles it each time.

I'm already at 800 and still have 6/9.

looking to skipping this first round as don't want to keep making too much logic...
doh, this is golf, not logical match [Wink]


Sealeopard
(KiX Master)
2003-05-29 06:16 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Part of Golf is how to hit the ball to reach the target. [Smile]

I can tell you my approach, so far everything is being done with the binary representations of IP addresses. I just have the IP address array left to be coded but already have a rough idea how to solve that one.

Then it's down to consolidating code fragments to make them shorter and reduce the number and length or variables.

I also do not see anything complicated in there, a couple of binary ANDs and knowing what patterns to look for in a binary IP format.

Just be aware that the second round is shortened and only goes from Friday afternoon to Wednesday afternoon.


LonkeroAdministrator
(KiX Master Guru)
2003-05-29 08:59 PM
Re: KiXgolf: MOAN - Mother Of All Networks

doh, I have everything coded in binary but still have problems in the logic.
if I don't shorthen the variables, I have only 20 more strokes than my best shortened code.

what comes to binary, kixtart has total lack of binary functioning thus it's all about number and string manipulation rather than kixtart usage.


MightyR1
(MM club member)
2003-05-30 01:28 AM
Re: KiXgolf: MOAN - Mother Of All Networks

TODO: IPnumbers

So Far I Got:

code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 01:33:09.296
Processing End = 2003/05/30 01:33:09.326
Duration = 0000/00/00 00:00:00.029
# Loops = 1
KiXGolf Result = failed (7 out of 9 correct)
KiXGolf Score = 794

Thank you for participating in KiXtart Golf!



MightyR1
(MM club member)
2003-05-30 02:21 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Little bit if cheating [Big Grin]

IP section only works for C class for now...

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows XP Professional
CPU = Mobile Intel(R) Pentium(R) 4 - M CPU 2.20GHz
Speed = 1196 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 02:24:40.551
Processing End = 2003/05/30 02:24:40.591
Duration = 0000/00/00 00:00:00.040
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 1060

Thank you for participating in KiXtart Golf!



Sealeopard
(KiX Master)
2003-05-30 03:09 AM
Re: KiXgolf: MOAN - Mother Of All Networks

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.KIX

Computer
OS = Windows 2000 Server
CPU = Intel Pentium III
Speed = 1000 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/29 21:16:11.084
Processing End = 2003/05/29 21:16:11.135
Duration = 0000/00/00 00:00:00.050
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 2112

Thank you for participating in KiXtart Golf!

I know, it's not stellar but I only spend about five hours of work on it and I haven't even started optimizing it. It does satisfy all conditions and should even be able to handle bogus data.


Howard Bullock
(KiX Supporter)
2003-05-30 03:23 AM
Re: KiXgolf: MOAN - Mother Of All Networks

And the Golfers hit the fairway [Cool] I decided to try to write another solution utilizing a different approach. We'll see what happens.

Sealeopard
(KiX Master)
2003-05-30 05:14 AM
Re: KiXgolf: MOAN - Mother Of All Networks

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.KIX

Computer
OS = Windows 2000 Server
CPU = Intel Pentium III
Speed = 1000 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/29 23:20:29.266
Processing End = 2003/05/29 23:20:29.316
Duration = 0000/00/00 00:00:00.050
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 1247

Thank you for participating in KiXtart Golf!

I'm done for this round. There's no way I can still improve this score.


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 11:26 AM
Re: KiXgolf: MOAN - Mother Of All Networks

I decided to compine my methods into one udf.
thus got a result of:
code:
 
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 12:33:22.597
Processing End = 2003/05/30 12:33:22.777
Duration = 0000/00/00 00:00:00.180
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 904

Thank you for participating in KiXtart Golf!



Richard H.Administrator
(KiX Supporter)
2003-05-30 11:37 AM
Re: KiXgolf: MOAN - Mother Of All Networks

The rules actually require a single UDF, one of the reasons I didn't look at coding as it makes the whole thing far more complicated and I knew I wouldn't get time to get a working result:

quote:
All functionality of the UDF must be contained within the FUNCTION/ENDFUNCTION commands. You are not allowed to call code located outside the UDF.
quote:
  • The UDF should be self-contained (except for any I/O mentioned in the challenge). In particular, you may not do things like fetching extra data from a remote site.
  • You are not allowed to use additional code that is external to the MOAN UDF. All code must be contained within the MOAN UDF.



LonkeroAdministrator
(KiX Master Guru)
2003-05-30 11:55 AM
Re: KiXgolf: MOAN - Mother Of All Networks

not sure that this actually works but the it passes the tests and am happy about that [Wink]

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 13:01:55.310
Processing End = 2003/05/30 13:01:55.420
Duration = 0000/00/00 00:00:00.110
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 874

Thank you for participating in KiXtart Golf!



LonkeroAdministrator
(KiX Master Guru)
2003-05-31 12:04 AM
Re: KiXgolf: MOAN - Mother Of All Networks

btw, if not sub udf's are allowed anymore, my score is false as have one.

LonkeroAdministrator
(KiX Master Guru)
2003-05-31 12:26 AM
Re: KiXgolf: MOAN - Mother Of All Networks

the question still remains...

anyway, hoby, start coding:

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 13:34:10.793
Processing End = 2003/05/30 13:34:10.923
Duration = 0000/00/00 00:00:00.130
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 832

Thank you for participating in KiXtart Golf!

w00t...
quote:

KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 829



[ 30. May 2003, 12:34: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2003-05-31 12:41 AM
Re: KiXgolf: MOAN - Mother Of All Networks

Now you do this when I have to go to work! [Frown] There should be a rule against posting a better score when I have to go to work. [Big Grin]

Crap!


LonkeroAdministrator
(KiX Master Guru)
2003-05-31 12:43 AM
Re: KiXgolf: MOAN - Mother Of All Networks

are you at home already?
quote:

KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 13:50:22.790
Processing End = 2003/05/30 13:50:22.961
Duration = 0000/00/00 00:00:00.171
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 826

uhm, still found something...
quote:

KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 13:54:53.189
Processing End = 2003/05/30 13:54:53.289
Duration = 0000/00/00 00:00:00.099
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 823

Thank you for participating in KiXtart Golf!



[ 30. May 2003, 12:48: Message edited by: Lonkero ]


Howard Bullock
(KiX Supporter)
2003-05-30 01:17 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I am not out of this yet! Just a little more to go [Razz]
code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 698 MHz
Memory = 512 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 07:24:23.255
Processing End = 2003/05/30 07:24:23.345
Duration = 0000/00/00 00:00:00.090
# Loops = 1
KiXGolf Result = passed (10 out of 10 correct)
KiXGolf Score = 836

Thank you for participating in KiXtart Golf!



JochenAdministrator
(KiX Supporter)
2003-05-30 01:21 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Howard,

just sitting here and watch the course (as always [Roll Eyes] )

How did you manage to get a result of '10 out of 10' while all others have '9 of 9' (or even SevenOfNine) [Confused] [Confused] [Confused]


Howard Bullock
(KiX Supporter)
2003-05-30 01:27 PM
Re: KiXgolf: MOAN - Mother Of All Networks

SevenOfNine sure would be my preference...but I added a test for the hell of it. [Big Grin]

LonkeroAdministrator
(KiX Master Guru)
2003-05-30 01:28 PM
Re: KiXgolf: MOAN - Mother Of All Networks

not sure...
but if /31 is proper mask then also x.x.x.255 is proper ip.
that brings me to:

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 14:31:47.794
Processing End = 2003/05/30 14:31:47.924
Duration = 0000/00/00 00:00:00.129
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 814

Thank you for participating in KiXtart Golf!

please do correct me if I'm wrong...
also did some fixing to this version otherwise would be lower (found a buggie)


Howard Bullock
(KiX Supporter)
2003-05-30 01:30 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Argh...I can't keep up [Mad]

JochenAdministrator
(KiX Supporter)
2003-05-30 01:35 PM
Re: KiXgolf: MOAN - Mother Of All Networks

nnn.nnn.nnn.255 is NOT a proper IP as it is reserved for broadcasts ...

well you could also argue about that [Roll Eyes]


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 01:42 PM
Re: KiXgolf: MOAN - Mother Of All Networks

jochen, that is the point.
the current rules allow 31 as mask that allows ip to be:
x.x.x.0 and x.x.x.255

btw hoby, even though my code works with current tests, it seems to have a problem with specific idiotic input...
will see if I can correct that but mostlikely that raises the score (as always)

so, don't loose your faith bro.


Howard Bullock
(KiX Supporter)
2003-05-30 01:42 PM
Re: KiXgolf: MOAN - Mother Of All Networks

I have to go to work. [Frown] It look's like I can't get much more out of this code now and will lack time at work. Good job Lonkero.

MightyR1
(MM club member)
2003-05-30 01:54 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Me too am stuck. Think the Lonk did it again. Curious about his code [Wink]

Here's my latest:

code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows XP Professional
CPU = Intel(R) Pentium(R) 4 CPU 2.80GHz
Speed = 2784 MHz
Memory = 510 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 13:59:00.250
Processing End = 2003/05/30 13:59:00.250
Duration = 0000/00/00 00:00:00.000
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 1033

Thank you for participating in KiXtart Golf!

Note: Don't think this will pass cause only "C" ip number calculations functions.

Note 2:
take a look at my duration... [Big Grin] [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 02:27 PM
Re: KiXgolf: MOAN - Mother Of All Networks

dudes, don't give up yet.

I think the winning score will have some fight as there surely is situations when they don't meet the requirements.

well, can't say for sure but know that my udf has pitfalls.

like, I have double udf.
as jens hasn't stated it more specifically I took it as it has been, multiple udf's are allowed if they just are scored too.


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 03:00 PM
Re: KiXgolf: MOAN - Mother Of All Networks

quote:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 16:07:37.712
Processing End = 2003/05/30 16:07:37.822
Duration = 0000/00/00 00:00:00.110
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 808

Thank you for participating in KiXtart Golf!

quote:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 16:09:45.295
Processing End = 2003/05/30 16:09:45.395
Duration = 0000/00/00 00:00:00.099
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 807

quote:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 16:19:31.809
Processing End = 2003/05/30 16:19:31.929
Duration = 0000/00/00 00:00:00.119
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 792


KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 789


[ 30. May 2003, 15:16: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2003-05-30 03:20 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Okay, time for me to jump in and cite from the rules:
quote:
You are not allowed to use additional code that is external to the MOAN UDF. All code must be contained within the MOAN UDF.
Thus, the first example is valid while the second example is not valid as code outside the MOAN UDF is being called
code:
;example 1
;!
function moan($a,$b,$c)
; doing my thing
endfunction
;!
;!

code:
;example 2
;!
function moan($a,$b,$c)
$a=externaludf($b)
endfunction
function externaludf($a)
endfunction
;!
;!

However, COM calls to components that are part of a standard Windows installation are allowed. That is covered in the rules, too.

I'm glad to see that we finally have some competition going on [Big Grin]


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 03:27 PM
Re: KiXgolf: MOAN - Mother Of All Networks

k, my all scores can be trashed.
was just to post 785 but as the rules are what they are, I have no score and thus hoby is the leader.


Sealeopard
(KiX Master)
2003-05-30 03:35 PM
Re: KiXgolf: MOAN - Mother Of All Networks

That part has always been in there right from when I originally posted the KiXgolf challenge.

Sealeopard
(KiX Master)
2003-05-30 03:48 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Got a new score:
code:
KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 09:52:58.508
Processing End = 2003/05/30 09:52:58.678
Duration = 0000/00/00 00:00:00.169
# Loops = 1
KiXGolf Result = passed (13 out of 13 correct)
KiXGolf Score = 1265

Thank you for participating in KiXtart Golf!

I've used my own updated .INI file which contaisn a couple of traps ;-) I've posted it below:
code:
;WARNING: Some lines are broken for readability purposes. Please unbreak before using.
[Test 1]
IP=192.168.1.2
NetworkID=192.168.1.0
SubnetMask=255.255.255.0
Solution=1

[Test 2]
IP=192.168.0.1
NetworkID=192.168.1.0
SubnetMask=255.255.255.0
Solution=0

[Test 3]
IP=192.168.10.123
NetworkID=192.168.10.0
SubnetMask=255.255.255.192
Solution=0

[Test 4]
IP=
NetworkID=10.10.5.4
SubnetMask=255.255.255.252
Solution=10.10. 5. 5,10.10. 5. 6

[Test 5]
IP=192.10.128.55
NetworkID=
SubnetMask=27
Solution=192.10.128.32

[Test 6]
IP=
NetworkID=12.65.55.16
SubnetMask=28
Solution=12.65.55.17,12.65.55.18,12.65.55.19,12.65.55.20,12.65.55.21,
12.65.55.22,12.65.55.23,12.65.55.24,12.65.55.25,12.65.55.26,
12.65.55.27,12.65.55.28,12.65.55.29,12.65.55.30

[Test 7]
IP=10.10.10.2
NetworkID=
SubnetMask=255.255.255.254
Solution=

[Test 8]
IP=10.10.10.2
NetworkID=10.10.10.0
SubnetMask=
Solution=255.255.254.0,255.255.255.0,255.255.255.128,255.255.255.192,
255.255.255.224,255.255.255.240,255.255.255.248,255.255.255.252
SolutionAlternate=/23,/24,/25,/26,/27,/28,/29,/30

[Test 9]
IP=192.168.99.55
NetworkID=192.168.99.55
SubnetMask=
Solution=

[Test 10]
IP=192.168.255.128
NetworkID=192.168.255.128
SubnetMask=255.255.255.128
Solution=1

[Test 11]
IP=123.123.123.63
NetworkID=123.123.123.32
SubnetMask=27
Solution=1

[Test 12]
IP=123.123.123.34
NetworkID=123.123.123.33
SubnetMask=31
Solution=

[Test 13]
IP=
NetworkID=
SubnetMask=
Solution=



Richard H.Administrator
(KiX Supporter)
2003-05-30 03:54 PM
Re: KiXgolf: MOAN - Mother Of All Networks

As there was a little confusion over the rules, I don't think this helper is out of order...

There is a way of getting around the requirement for having a single function without adding too much to your code, providing you don't need more than two parameters:
code:
Function Moan($a,$b,$c)
Select
Case $a="!1"
; Code from first external function
Exit 0
Case $a="!2"
; Code from second external function
Exit 0
EndSelect
...
; Normal MOAN code
; Call first "external" function
$x=Moan("!1",$y,"")
; More Moan code
; Call second "external" function
$u=Moan("!2",$v,$w)
EndFunction

If you only have a single external function then a simple If/EndIf will suffice.


LonkeroAdministrator
(KiX Master Guru)
2003-05-30 04:07 PM
Re: KiXgolf: MOAN - Mother Of All Networks

sure, but coded it in already [Big Grin]
code:
KiXtart
KiXtart Version = 4.21
KiXGolf Script = kixgolf_moan.kix

Computer
OS = Windows 2000 Professional
CPU = Intel Pentium III
Speed = 797 MHz
Memory = 376 MB

KiXGolf Scoring Engine
Scoring Engine = 3.0.3

KiXtart Golf Score
Tournament = KiXtart Golf: MOAN - Mother Of All Networks
Processing Start = 2003/05/30 17:14:12.316
Processing End = 2003/05/30 17:14:12.426
Duration = 0000/00/00 00:00:00.110
# Loops = 1
KiXGolf Result = passed (9 out of 9 correct)
KiXGolf Score = 807

Thank you for participating in KiXtart Golf!

nah, let's make it not so:
code:
KiXGolf Score       = 806



[ 30. May 2003, 16:08: Message edited by: Lonkero ]


Sealeopard
(KiX Master)
2003-05-30 04:12 PM
Re: KiXgolf: MOAN - Mother Of All Networks

An EXECUTE() would work, too! [Big Grin]

LonkeroAdministrator
(KiX Master Guru)
2003-05-30 04:14 PM
Re: KiXgolf: MOAN - Mother Of All Networks

jens, you have mistype there.
test 12 has actually correct result of 0.

anyway, gladly the 13 is not one of the tasks [Wink]
get overflow exception and if I would code around it, that would cause at least 10 strokes more.


Howard Bullock
(KiX Supporter)
2003-05-30 09:16 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Should I post my code?

Sealeopard
(KiX Master)
2003-05-30 09:22 PM
Re: KiXgolf: MOAN - Mother Of All Networks

Please post your codes here: KIXgolf: MOAN(), Part II