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

This is the cop's thread. The robber's thread is hererobber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that fully matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Notes:

  • You must support any reasonably large n. You may assume it won't overflow the datatype or memory. If the default datatype is 8-bit signed integers, then you can assume n<=11, if it's unsigned 8-bit integers, then you can assume n<=15.
  • The robbers have to match the submission's output format, except leading/trailing spaces and newlines, since that might have been stripped away by the SE formatting.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

This is the cop's thread. The robber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that fully matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Notes:

  • You must support any reasonably large n. You may assume it won't overflow the datatype or memory. If the default datatype is 8-bit signed integers, then you can assume n<=11, if it's unsigned 8-bit integers, then you can assume n<=15.
  • The robbers have to match the submission's output format, except leading/trailing spaces and newlines, since that might have been stripped away by the SE formatting.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

This is the cop's thread. The robber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that fully matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Notes:

  • You must support any reasonably large n. You may assume it won't overflow the datatype or memory. If the default datatype is 8-bit signed integers, then you can assume n<=11, if it's unsigned 8-bit integers, then you can assume n<=15.
  • The robbers have to match the submission's output format, except leading/trailing spaces and newlines, since that might have been stripped away by the SE formatting.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

Added spaces to satisfy DLosc :P
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304

This is the cop's thread. The robber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1  2  3  4 8  7  6  5 9  10  11  12 16  15  14  13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that fully matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Notes:

  • You must support any reasonably large n. You may assume it won't overflow the datatype or memory. If the default datatype is 8-bit signed integers, then you can assume n<=11, if it's unsigned 8-bit integers, then you can assume n<=15.
  • The robbers have to match the submission's output format, except leading/trailing spaces and newlines, since that might have been stripped away by the SE formatting.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

This is the cop's thread. The robber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

This is the cop's thread. The robber's thread is here.


Write a code that takes an input n and creates a n-by-n "snake matrix".

A snake matrix is a matrix that follows this pattern:

3-by-3:

1 2 3 6 5 4 7 8 9 

and 4-by-4:

1  2  3  4 8  7  6  5 9  10  11  12 16  15  14  13 

The exact output format is optional. You may for instance output [[1 2 3],[6 5 4],[7 8 9]], or something similar.

You must provide the language name, and a regex that fully matches your code. You can choose how detailed your regex should be. In the extreme, you can write a regex that matches every possible string, in which case it will be very easy to crack your code. You must also provide the output for n=4, so that robbers know the exact format you have opted for.

You may use one of the regex-flavors that are available on regex101.com, or the Ruby flavor.

  • PCRE (PHP)
  • Javascript
  • Python
  • Golang
  • Ruby

You must specify which one you are using.

Notes:

  • You must support any reasonably large n. You may assume it won't overflow the datatype or memory. If the default datatype is 8-bit signed integers, then you can assume n<=11, if it's unsigned 8-bit integers, then you can assume n<=15.
  • The robbers have to match the submission's output format, except leading/trailing spaces and newlines, since that might have been stripped away by the SE formatting.

Winning criterion:

The winner will be the uncracked submission with the shortest regex, measured in number of characters.

If your post has remained uncracked for 7 days, then you may post the intended solution and mark your submission as safe.

edited title
Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304

Cops: Crack theMake a regex - Make a snake

Tweeted twitter.com/StackCodeGolf/status/839493852151050241
minor typo
Source Link
ETHproductions
  • 50.3k
  • 6
  • 96
  • 241
Loading
Source Link
Stewie Griffin
  • 46.8k
  • 16
  • 140
  • 304
Loading