Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Keoni29 on July 11, 2014, 03:21:14 pm

Title: Calculator applet from url
Post by: Keoni29 on July 11, 2014, 03:21:14 pm
Inspired by haroldbot, regular expressions and javascript applets for converting hex to decimal I introduce: Calculator applet generator.


I have not coded it up but this is what is might look like.
Example: Relative jump calculator applet:
Code: [Select]
1x(0..65535)  "Jump From:",
2x(0..65535)  "To:",
0x(-127..128) "Offset:"
:$2 - $1 [ ! - 2]


This describes the following applet:

Jump From:
[Hexadecimal input] (range 16 bits)
To:
[Hexadecimal input] (range 16 bits)
Enable -2? [Yes]

Offset:
[Hexadecimal output] (range 8 bits signed)


The url to this applet would look like this: mypage.com/?d='1x(0..65535)  "Jump From:",2x(0..65535)  "To:",0x(-127..128) "Offset:" :$2 - $1 [ ! - 2]'

What do you think?