Please Disable Ad-Block To View This Website.

If you block ads, this site can not survive!

Ads are very minimal for registered users. If you don't have an account please register now!

DOWNLOAD
 Full Scripts
 Addons
 Snippets
 DLLs
 MTS Themes
 Tutorials
 Misc.
 File Queue
 Download mIRC
INTERACT
 Screenshots
 Challenge
 Top Downloads
 Submit Form
 Forums

SEARCH
Site Search

FRIENDS
Link to us!
PhotoShelf

Top Challenge Entrants

  # User Points
  1 jaytea 587
  2 [Znork] 303
  3 urza 297
  4 Ag2X 288
  5 dr_Eamer 255
  6 Albie 199
  7 Chessnut 197
  8 A Noniem 194
  9 zzattack 186
  10 Kol 185
  11 m910q 168
  12 Sephiroth 115
  13 Auron956 114
  14 patje 114
  15 chid 110
  16 Ohad2121 92
  17 SkorpSSS 87
  18 DixrouE 84
  19 Suchorski 83
  20 ^Vampire^ 74
Challenge:Smallest $boxes
Start:August 31st 2009
End:September 9th 2009
Description:

In this challenge you are asked to calculate how many boxes are available to be taken in a move in the paper game Dots and Boxes



Alias format & Parameters

The alias will be in the format:

$boxes(<lines going horizontal>,<lines going vertical>)

A line going horizontal/vertical is represented by "1".
No line going horizontal/vertical in this position is represented by "0".

The positions are read from left to right, top to bottom. To fully understand the data format, please see the examples below.

The input grid can consist of boxes which are already taken/filled. See figure 3. You can assume the grid will always be a square.

Simple examples

figure 1

figure2

figure 3

figure 4

figure 5





figure 1
$boxes(11 10 11,100 001) = 1

figure 2
$boxes(100 010 001 011,1111 1101 1100) = 4

figure 3
$boxes(111 110 101 111,1111 1101 1100) = 5

figure 4
$boxes(11111 10000 00000 01100 11101 11111,100100 101111 011011 100100 000000) = 5

figure 5
$boxes(111 000 011 111,0010 1100 0000) = 0



Validation

You can assume;
  • The grid only consists of 1's and 0's and new cols/rows are seperated by spaces
  • Grid is a square
  • Up to a grid size 10x10 will be tested.

Further reading & Sources





Example:

$boxes(11 00 00,111 111) = 4
$boxes(01 00 00,111 111) = 2
$boxes(000 000 000 111,1111 1111 1000) = 0
$boxes(111 000 000 111,1111 1111 1000) = 9
$boxes(0010 1000 0000 0000 0000,00110 11110 11110 10010) = 5




Rules:

  • Alias name must be 'boxes'
  • No dlls, coms, sockets
  • One submission per user per entry type.
  • Script must give correct results after consecutive runs.


  • Testing conditions:

  • Alias will be run on mIRC v6.35 and loaded into the remotes section.
  • Last closing bracket can be omitted }
  • Your code will be taken for EXACTLY as-is.
  • Alias will be run on a mIRC with no variables set - a clean mIRC.