easiest mathematical scripting tool
-
- Posts: 15
- Joined: Sun Sep 14, 2008 4:49 pm
easiest mathematical scripting tool
Hi there,
I've managed to solve 37 challenges without any knowledge about programming but now I have various ideas to solve a challenge but no experience in scripting. And I believe that the fast typing challenges teaches that there is another way...
Any recommendations on accesible scripting languages. I work with a Mac Os X...
Thanks
I've managed to solve 37 challenges without any knowledge about programming but now I have various ideas to solve a challenge but no experience in scripting. And I believe that the fast typing challenges teaches that there is another way...
Any recommendations on accesible scripting languages. I work with a Mac Os X...
Thanks
Re: easiest mathematical scripting tool
BC is an excellent calculator language that can be used to solve mathematical problems, and for things that require a bit more general capabilities, I'd suggest python.sjoemelfreek wrote:Hi there,
I've managed to solve 37 challenges without any knowledge about programming but now I have various ideas to solve a challenge but no experience in scripting. And I believe that the fast typing challenges teaches that there is another way...
Any recommendations on accesible scripting languages. I work with a Mac Os X...
Thanks
I know the best language!
All the top hackers here use it when solving challenges.
It's available for free.
It can run on web browsers, so it must work on Mac OS X.
As well as simple calculation, by using it you can count string length, do fast modulus, generate messages, and even solve a maze!
Its program is like this: 23+p
All the top hackers here use it when solving challenges.
It's available for free.
It can run on web browsers, so it must work on Mac OS X.
As well as simple calculation, by using it you can count string length, do fast modulus, generate messages, and even solve a maze!
Its program is like this: 23+p
wattails wrote:I know the best language!
All the top hackers here use it when solving challenges.
It's available for free.
It can run on web browsers, so it must work on Mac OS X.
As well as simple calculation, by using it you can count string length, do fast modulus, generate messages, and even solve a maze!
Its program is like this: 23+p
I prefer dc to bc, and tails's program runs fine in dc as well as hvm.
They're pretty similar, but you can use the differences between them in interesting ways, e.g. this rather long program prints a different message depending which one you run it in:
They're pretty similar, but you can use the differences between them in interesting ways, e.g. this rather long program prints a different message depending which one you run it in:
Code: Select all
9 3+9*4-4 8*dP9 4+9*1+4 5*5*dP9 3+9*1+9 2+9*dP4 8*P9 3+9*6+P9 3+9*3+P9 2+9*P9 3+9*1-P9 3+9*7+P9 1+P
Elaborate. I am not sure what you mean by `HVM'.tails wrote:A joke. You know we have to use HVM to solve some challenges.canine wrote:wat
I'm not such a fan of dc. It's terse and complicated and I find polish notation unnatural. Furthermore, bc has alot more features, such as functions.gfoot wrote:I prefer dc to bc, and tails's program runs fine in dc as well as hvm.
They're pretty similar, but you can use the differences between them in interesting ways, e.g. this rather long program prints a different message depending which one you run it in:
Code: Select all
9 3+9*4-4 8*dP9 4+9*1+4 5*5*dP9 3+9*1+9 2+9*dP4 8*P9 3+9*6+P9 3+9*3+P9 2+9*P9 3+9*1-P9 3+9*7+P9 1+P
hvm is a virtual machine similar to dc. http://www.hacker.org/hvm/
I know what you mean about dc, and reverse-polish notation. But dc does have functions - any string between square braces can be stored in a variable and executed later.
I know what you mean about dc, and reverse-polish notation. But dc does have functions - any string between square braces can be stored in a variable and executed later.
Hmm...gfoot wrote:hvm is a virtual machine similar to dc. http://www.hacker.org/hvm/
I know what you mean about dc, and reverse-polish notation. But dc does have functions - any string between square braces can be stored in a variable and executed later.
The bracket thing in dc is actually a macro, which functions similarly to a function, but is not quite the same thing.
Compare functions in C and macros in C.
Do any challenges actually require hvm? Anyhow, it looks interesting. I may churn out a C implementation sometime, for the fun of it.
Heh. This reminds me of brainfuck.
Although dc calls them macros, they're effectively functions. I can't think of anything a function can do that a dc macro can't. They can recurse indefinitely, and they're not actually expanded until they're executed - the macro is (usually) loaded onto the stack and executed from there. You can return early from a macro (with the quirk that you also kill your parent).canine wrote:Compare functions in C and macros in C.
Hmm...gfoot wrote:Although dc calls them macros, they're effectively functions. I can't think of anything a function can do that a dc macro can't. They can recurse indefinitely, and they're not actually expanded until they're executed - the macro is (usually) loaded onto the stack and executed from there. You can return early from a macro (with the quirk that you also kill your parent).canine wrote:Compare functions in C and macros in C.
Indeed.