Numeric Batch

From Esolang
Jump to navigation Jump to search

Numeric Batch is an alternate form of Batch which has been entirely programmed in Batch. Created by User:Shubshub on 27 April 2012 in New Zealand.

Information

Numeric Batch was created by Shubshub to make programming in batch more challenging and to make it seem better as it is theoretically unreadable unless you use the translator.

The source code of the interpreter is here:

@echo off
call %1
set str=%str:?eighteen?=a%
set str=%str:?five?=b%
set str=%str:?one?=c%
set str=%str:?nineteen?=d%
set str=%str:?two?=e%
set str=%str:?four?=f%
set str=%str:?twentythree?=g%
set str=%str:?twenty?=h%
set str=%str:?fourteen?=i%
set str=%str:?sixteen?=j%
set str=%str:?twentyfive?=k%
set str=%str:?twentyfour?=l%
set str=%str:?twentyone?=m%
set str=%str:?nine?=n%
set str=%str:?twentytwo?=o%
set str=%str:?ten?=p%
set str=%str:?twentysix?=q%
set str=%str:?six?=r%
set str=%str:?three?=s%
set str=%str:?eight?=t%
set str=%str:?thirteen?=u%
set str=%str:?fifteen?=v%
set str=%str:?seven?=w%
set str=%str:?twelve?=x%
set str=%str:?eleven?=y%
set str=%str:?seventeen?=z%
set str=%str:?and?=&%
%str%
pause

Paste that source code into NumericBatch.cmd and drag your NumericBatch script (can be either .bat or .cmd) onto the file and it will execute the code by converting the code into pure batch

Here is hello world example in NumericBatch

set str=?two??one??twenty??twentytwo? ?twenty??two??twentyfour??twentyfour??twentytwo? ?seven??twentytwo??six??twentyfour??nineteen?

You can perform multiline commands by doing

set str=<first line of code>
set str=%str% ?and? <second line of code here>
set str=%str% ?and? <next line of code so on so on>

Without an infinite line translator code the program can only interpret things on the set str= and does not handle set commands very well then executing another command after as it will most likely skip over that next command completely

See also