Created
October 4, 2013 16:34
-
-
Save foldi/6828805 to your computer and use it in GitHub Desktop.
Magic regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colors = { | |
empty: 0, | |
brown: 1, | |
green: 2, | |
blue: 3, | |
cyan: 4, | |
magenta: 5, | |
yellow: 6, | |
black: 7, | |
gray: 8 | |
}; | |
items = { | |
2: { | |
'/^[^0-9]*7[^0-9]*1[^0-9]*$/': 'torch' | |
}, | |
3: { | |
'/^[^0-9]*3[^0-9]*3[^0-9]*1[^0-9]*$/': 'wooden sword', | |
'/^[^0-9]*4[^0-9]*1[^0-9]*5[^0-9]*$/': 'arrow', | |
'/^[-]*222[-]*$/gm': 'paper' | |
}, | |
5: { | |
'/^[^0-9]*666[^0-9]*1[^0-9]*1[^0-9]*$/': 'gold pickaxe', | |
'/^[^0-9]*88[^0-9]*81[^0-9]*1[^0-9]*$/': 'iron axe' | |
}, | |
8: { | |
'/^[^0-9]*333[^0-9]*3[^0-9]*3[^0-9]*333[^0-9]*$/': 'chest' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment