Last active
January 23, 2017 01:33
-
-
Save nshiff/738753d554789764f5066aec8a7df53e to your computer and use it in GitHub Desktop.
This is custom code intended to simplify the creation of custon cross-stitch designs using the interactive Alphabet Generator at http://www.stitchpoint.com/eng/tool/alph/chart_alphabet_amsterdam.php
This file contains hidden or 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
/* | |
Use: | |
- Visit web app and paste code into the Javascript console. | |
- If you are unfamiliar, this is like a command prompt for a web page. | |
- Right-click, "Inspect Element." Press Escape to show or hide the console. | |
- You can run a test command like | |
alert("Hello!") | |
- Paste all this code into the console and press Enter to run. | |
- Use command to create one line of text. To delete, or to add a newline, use the existing interface. | |
stitch("Hello, World!") | |
- This is custom code intended to simplify the creation of custon cross-stitch designs | |
using the interactive Alphabet Generator at http://www.stitchpoint.com/eng/tool/alph/chart_alphabet_amsterdam.php | |
The target application was created by the StitchPoint organization in the Netherlands - thank you! | |
Example designs | |
https://i.imgur.com/xPCeHr7.png | |
Example designs completed | |
https://i.imgur.com/kqfxzLM.jpg | |
*/ | |
var charactersAsNumbers = { | |
'a': 1, | |
'b': 2, | |
'c': 3, | |
'd': 4, | |
'e': 5, | |
'f': 6, | |
'g': 7, | |
'h': 8, | |
'i': 9, | |
'j': 10, | |
'k': 11, | |
'l': 12, | |
'm': 13, | |
'n': 14, | |
'o': 15, | |
'p': 16, | |
'q': 17, | |
'r': 18, | |
's': 19, | |
't': 20, | |
'u': 21, | |
'v': 22, | |
'w': 23, | |
'x': 24, | |
'y': 25, | |
'z': 26, | |
'A': 27, | |
'B': 28, | |
'C': 29, | |
'D': 30, | |
'E': 31, | |
'F': 32, | |
'G': 33, | |
'H': 34, | |
'I': 35, | |
'J': 36, | |
'K': 37, | |
'L': 38, | |
'M': 39, | |
'N': 40, | |
'O': 41, | |
'P': 42, | |
'Q': 43, | |
'R': 44, | |
'S': 45, | |
'T': 46, | |
'U': 47, | |
'V': 48, | |
'W': 49, | |
'X': 50, | |
'Y': 51, | |
'Z': 52, | |
'1': 55, | |
'2': 56, | |
'3': 57, | |
'4': 58, | |
'5': 59, | |
'6': 60, | |
'7': 61, | |
'8': 62, | |
'9': 63, | |
'0': 64, | |
'.': 65, | |
',': 66, | |
'-': 67, | |
'!': 68, | |
'?': 69, | |
'\'': 70, | |
':': 71, | |
'=': 72, | |
'+': 73, | |
'×': 74, | |
';': 75, | |
'*': 76, | |
'¿': 77, | |
'/': 78, | |
'\\': 79, | |
'&': 80, | |
'@': 81, | |
'©': 82, | |
'†': 83, | |
'±': 84, | |
'€': 85, | |
'$': 86, | |
'£': 87, | |
'°': 88, | |
'ä': 89, | |
'á': 90, | |
'à': 91, | |
'â': 92, | |
'å': 93, | |
'æ': 94, | |
'ç': 95, | |
'è': 96, | |
'é': 97, | |
'ê': 98, | |
'ï': 99, | |
'ñ': 100, | |
'ņ': 101, | |
'ň': 102, | |
'ö': 103, | |
'ŏ': 104, | |
'ø': 105, | |
'œ': 106, | |
'ü': 107, | |
'ū': 108, | |
'ų': 109, | |
'ű': 110, | |
'ÿ': 111, | |
'Ä': 112, | |
'Á': 113, | |
'Å': 114, | |
'Æ': 115, | |
'Ç': 116, | |
'Ð': 117, | |
'Ö': 118, | |
'Ø': 119, | |
'Œ': 120, | |
'ß': 121, | |
'Ž': 122, | |
' ': 123, | |
}; | |
function stitch(message){ | |
for(var i=0; i<message.length; i++){ | |
var character = message.charAt(i); | |
var characterAsNumber = charactersAsNumbers[character]; | |
schrijfop(characterAsNumber); | |
} | |
} | |
function STITCH(message){ | |
stitch(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment