Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Here is a picture of a diamond tiling shamelessly stolen from Random ASCII Art of the Day #5: Diamond TilingsRandom ASCII Art of the Day #5: Diamond Tilings:

Your task is, given an ASCII art representation of a diamond tiling, is to output both the number of cubes removed and remaining. For example (some shamelessly stolen from Scale up a Diamond TilingScale up a Diamond Tiling):

Here is a picture of a diamond tiling shamelessly stolen from Random ASCII Art of the Day #5: Diamond Tilings:

Your task is, given an ASCII art representation of a diamond tiling, is to output both the number of cubes removed and remaining. For example (some shamelessly stolen from Scale up a Diamond Tiling):

Here is a picture of a diamond tiling shamelessly stolen from Random ASCII Art of the Day #5: Diamond Tilings:

Your task is, given an ASCII art representation of a diamond tiling, is to output both the number of cubes removed and remaining. For example (some shamelessly stolen from Scale up a Diamond Tiling):

added 243 characters in body
Source Link
Neil
  • 172.9k
  • 20
  • 9

Your task is, given an ASCII art representation of a diamond tiling, is to output both the number of cubes removed and remaining (in any order), for. For example (some shamelessly stolen from Scale up a Diamond Tiling):

The output can be in any reasonable format, e.g. an array return value or a string with whitespace, but it must contains both values, even if they are the same, however the order of the two values does not matter in any way; you could even reverse the order on subsequent runs if you wanted to.

Your task is, given an ASCII art representation of a diamond tiling, is to output the number of cubes removed and remaining (in any order), for example (some shamelessly stolen from Scale up a Diamond Tiling):

Your task is, given an ASCII art representation of a diamond tiling, is to output both the number of cubes removed and remaining. For example (some shamelessly stolen from Scale up a Diamond Tiling):

The output can be in any reasonable format, e.g. an array return value or a string with whitespace, but it must contains both values, even if they are the same, however the order of the two values does not matter in any way; you could even reverse the order on subsequent runs if you wanted to.

added 358 characters in body
Source Link
Neil
  • 172.9k
  • 20
  • 9

Your task is, given an ASCII art representation of a diamond tiling, is to output the number of cubes removed and remaining (in any order), so for example the outputs should be 3 and 1 for these tilings(some shamelessly stolen from Scale up a Diamond Tiling):

    ____
   /   /\     
/___/  \ ________-> 1 0 or 0 ________1
 \ /___/  \  /
 \___\/
  ________
 /   /\   \    
/\ ___/  \\___\ -> 1 \1
 /\   \  /\    /___/  
 \___\ /___/
  \___\___\____________
/  \___\/  \  /\   \  / \
/___/  /\___\___\ \-> 2 /1 or 1 /2
\   \
\  /   /\  / /  
 \___\/___/   \/___/ 
  \___\________________
 \/___/  \ /\   \  / \   \
/___/  \___\___\___\ /-> 3 1 or 1 3
\   \  /   /
  \   \  /   /
 \\___\/___/___/___/ 
  ________
 /\   \ \___\/___/  \
/  \___\___\
\  \___\/

While for this example the number of cubes is 40 and 20:

   /\   ____________________\
 \/___/  \___\ -> /3 1 or /\1 3
  \   \   \/   \/
    \___\/___/ 
  \___\___\___\___\  ________
   /   /\   \ 
  /\___/  \___\ \-> 3 1 \or 1 3
 /\   \
   /  \___\/  \___\___\___\___\/
/  \___\/___/ 
\  /   /\  /  /
 \/___/___/
   / ____
   /\   /\
/  \/___/  \/___/___/___/  \___\
\  /\   \  / \
/  \___\/  \ -> 3 \1 or 1 3
\  /   /\
  \/ /
 \___\\/___/  \___\___\/___\/ 
  \
    \  / 
   \___\/\ 
   \ ________
   /   /\   \ 
  /___/ \ \___\
 /
 \   \/___/  \___\/___/  \___\___\ /\
/  \___\/___/  \ -> 4 4
\  /   /\   \  /   
 \/ ___/  \___\/
  \   \ \___\ /___   /
   \___\/___/___/
      \   \____________
   \  /   /   /\   /\
       \___\___\/___/___/___/

More examples shamelessly stolen from Scale up a Diamond Tiling:

  ____\___\
   /   /\
/___/  \ ->\ 1 0
/\   \ 
  /
 ___/  \___\/

   \___\
 /\ ________
  \  /   /\  /   /\
/  \___\/___/  \/___/  \___\\ -> 16 11 or 11 16
\  /   /\   \  /   /\  /
 \/___/  \___\/___/  \/
 -> 4\ 4
  \  /   /\   \  /
 \  \___\/___/  \___\/
    \   \   \  /   /
   \___\  \___\___\/___/
 
      ________________________________
     /   /\   /\   \   \   \
    /___/___  \___\___\___\___\
   /\  \___\ \  /\   \   \   \   \
  /  \___\/  \___\___\___\___\
 /\  /   /\  /   /   /   /\   \
/  \/___/  \___\\/___/___/___/  \___\
\  /\   \  /   /\   \   \  /   /\
 \/  \___\/___/  \\___\___\/___/  \ -> 1640 1120 or 20 40
  \  /   /\   \  /   /\   \   \  /
   \/___/  \___\/___/  \\___\___\/
    \   \  /   /\   \  /   /   /
     \___\/___/  \___\/___/___/
      \   \   \  /   /   /   /
       \___\___\/___/
 ___/___/
        ________________
       /   /\   \   \   \
      /___/  \___\___\___\
     /\   \  /\   \   \   \
    /  \___\/  \___\___\___\
   /\  /   /\  /   /   /\   \
  /  \/___/  \/___/___/  \___\
 /\  /\   \  /   /   /\  /\   \
/  \/  \___\/___/___/  \/  \___\ -> 46 18 or 18 46
\  /\  /   /\   \   \  /\  /   /
 \/  \/___/  \___\___\/  \/___/
  \  /\   \  /   /\   \  /   /
   \/  \___\/___/  \___\/___/
    \  /\   \   \  /   /   /
     \/  \___\___\/___/___/
      \  /   /   /   /   /
       \/___/___/___/___/

Your task is, given an ASCII art representation of a diamond tiling, is to output the number of cubes removed and remaining (in any order), so for example the outputs should be 3 and 1 for these tilings:

    ____
   /   /\        ________     ________
  /___/  \      /   /\   \   /\   \   \
 /\   \  /\    /___/  \___\ /  \___\___\
/  \___\/  \  /\   \  /   / \  /   /\   \
\  /   /\  / /  \___\/___/   \/___/  \___\
 \/___/  \/  \  /   /   /     \   \  /   /
  \   \  /    \/___/___/       \___\/___/
   \___\/

While for this example the number of cubes is 40 and 20:

      ____________________
     /   /\   \   \   \   \
    /___/  \___\___\___\___\
   /\   \  /\   \   \   \   \
   /  \___\/  \___\___\___\___\
 /\  /   /\  /   /   /   /\   \
/  \/___/  \/___/___/___/  \___\
\  /\   \  /   /\   \   \  /   /\
  \/  \___\/___/  \___\___\/___/  \
   \  /   /\   \  /   /\   \   \  /
    \/___/  \___\/___/  \___\___\/
    \   \  /   /\   \  /   /   /
     \___\/___/  \___\/___/___/
      \   \   \  /   /   /   /
       \___\___\/___/___/___/

More examples shamelessly stolen from Scale up a Diamond Tiling:

  ____
 /   /\
/___/  \ -> 1 0
\   \  /
  \___\/

     ________
   /   /\   \
  /___/  \___\
 /\   \  /   /\
/  \___\/___/  \ -> 4 4
\  /   /\   \  /
 \/___/  \___\/
  \   \  /   /
   \___\/___/
 
      ____________
     /   /   /\   \
    /___/___/  \___\
   /   /\   \  /\   \
  /___/  \___\/  \___\
 /\   \  /   /\  /   /\
/  \___\/___/  \/___/  \ -> 16 11
\  /   /\   \  /   /\  /
 \/___/  \___\/___/  \/
  \   \  /   /\   \  /
   \___\/___/  \___\/
    \   \   \  /   /
     \___\___\/___/
 
        ________________
       /   /\   \   \   \
      /___/  \___\___\___\
     /\   \  /\   \   \   \
    /  \___\/  \___\___\___\
   /\  /   /\  /   /   /\   \
  /  \/___/  \/___/___/  \___\
 /\  /\   \  /   /   /\  /\   \
/  \/  \___\/___/___/  \/  \___\ -> 46 18
\  /\  /   /\   \   \  /\  /   /
 \/  \/___/  \___\___\/  \/___/
  \  /\   \  /   /\   \  /   /
   \/  \___\/___/  \___\/___/
    \  /\   \   \  /   /   /
     \/  \___\___\/___/___/
      \  /   /   /   /   /
       \/___/___/___/___/

Your task is, given an ASCII art representation of a diamond tiling, is to output the number of cubes removed and remaining (in any order), for example (some shamelessly stolen from Scale up a Diamond Tiling):

  ____
 /   /\
/___/  \ -> 1 0 or 0 1
\   \  /
 \___\/
  ________
 /   /\   \ 
/___/  \___\ -> 1 1
\   \  /   / 
 \___\/___/
  ____________
 /   /\   \   \
/___/  \___\___\ -> 2 1 or 1 2
\   \  /   /   / 
 \___\/___/___/ 
  ________________
 /   /\   \   \   \
/___/  \___\___\___\ -> 3 1 or 1 3
\   \  /   /   /   /
 \___\/___/___/___/ 
  ________
 /\   \   \
/  \___\___\
\  /   /\   \
 \/___/  \___\ -> 3 1 or 1 3
  \   \  /   /
   \___\/___/ 
    ________
   /   /\   \ 
  /___/  \___\ -> 3 1 or 1 3
 /\   \  /   /
/  \___\/___/ 
\  /   /   /
 \/___/___/
    ____
   /   /\
  /___/  \
 /\   \  /\
/  \___\/  \ -> 3 1 or 1 3
\  /   /\  /
 \/___/  \/ 
  \   \  / 
   \___\/ 
    ________
   /   /\   \ 
  /___/  \___\
 /\   \  /   /\
/  \___\/___/  \ -> 4 4
\  /   /\   \  / 
 \/___/  \___\/
  \   \  /   /
   \___\/___/
      ____________
     /   /   /\   \
    /___/___/  \___\
   /   /\   \  /\   \ 
  /___/  \___\/  \___\
 /\   \  /   /\  /   /\
/  \___\/___/  \/___/  \ -> 16 11 or 11 16
\  /   /\   \  /   /\  /
 \/___/  \___\/___/  \/
  \   \  /   /\   \  /
   \___\/___/  \___\/
    \   \   \  /   /
     \___\___\/___/
      ____________________
     /   /\   \   \   \   \
    /___/  \___\___\___\___\
   /\   \  /\   \   \   \   \
  /  \___\/  \___\___\___\___\
 /\  /   /\  /   /   /   /\   \
/  \/___/  \/___/___/___/  \___\
\  /\   \  /   /\   \   \  /   /\
 \/  \___\/___/  \___\___\/___/  \ -> 40 20 or 20 40
  \  /   /\   \  /   /\   \   \  /
   \/___/  \___\/___/  \___\___\/
    \   \  /   /\   \  /   /   /
     \___\/___/  \___\/___/___/
      \   \   \  /   /   /   /
       \___\___\/___/___/___/
        ________________
       /   /\   \   \   \
      /___/  \___\___\___\
     /\   \  /\   \   \   \
    /  \___\/  \___\___\___\
   /\  /   /\  /   /   /\   \
  /  \/___/  \/___/___/  \___\
 /\  /\   \  /   /   /\  /\   \
/  \/  \___\/___/___/  \/  \___\ -> 46 18 or 18 46
\  /\  /   /\   \   \  /\  /   /
 \/  \/___/  \___\___\/  \/___/
  \  /\   \  /   /\   \  /   /
   \/  \___\/___/  \___\/___/
    \  /\   \   \  /   /   /
     \/  \___\___\/___/___/
      \  /   /   /   /   /
       \/___/___/___/___/
added 611 characters in body
Source Link
Neil
  • 172.9k
  • 20
  • 9
Loading
Source Link
Neil
  • 172.9k
  • 20
  • 9
Loading