Skip to main content

Windows Batch, 204204 256

@echo off
set a=0
:a
set /p i=^>^> 
if %i%==i set /a a=%a%+1
if %i%==x set /a a=%a%+1
if %i%==d set /a a=%a%-1
if %i%==s set /a a=%a%*%a%
if %i%==k set /a a=%a%*%a%
if %i%==o echo %a%
if %i%==c echo %a%
if %a%==256 set a=0
if %a%==-1 set a=0
set i=n
goto a

Successfully ignores other commands. Really got bloated without having or to work with...

Edit:

Fixed:

  • No more Echoing all commands
  • Made it actually DO math with /a
  • Reset on -1
  • Reset input after every cycle

This cost 52 characters.

Didn't fixed:

  • Squaring 0 writes "0*0" in a.
  • Inputting space (or inputing nothing, when you just opened it) crashes script.
  • You NEED to input one char at a time.

Windows Batch, 204

set a=0
:a
set /p i=^>^> 
if %i%==i set a=%a%+1
if %i%==x set a=%a%+1
if %i%==d set a=%a%-1
if %i%==s set a=%a%*%a%
if %i%==k set a=%a%*%a%
if %i%==o echo %a%
if %i%==c echo %a%
if %a%==256 set a=0
goto a

Successfully ignores other commands. Really got bloated without having or to work with...

Windows Batch, 204 256

@echo off
set a=0
:a
set /p i=^>^> 
if %i%==i set /a a=%a%+1
if %i%==x set /a a=%a%+1
if %i%==d set /a a=%a%-1
if %i%==s set /a a=%a%*%a%
if %i%==k set /a a=%a%*%a%
if %i%==o echo %a%
if %i%==c echo %a%
if %a%==256 set a=0
if %a%==-1 set a=0
set i=n
goto a

Successfully ignores other commands. Really got bloated without having or to work with...

Edit:

Fixed:

  • No more Echoing all commands
  • Made it actually DO math with /a
  • Reset on -1
  • Reset input after every cycle

This cost 52 characters.

Didn't fixed:

  • Squaring 0 writes "0*0" in a.
  • Inputting space (or inputing nothing, when you just opened it) crashes script.
  • You NEED to input one char at a time.
Source Link
Timtech
  • 12.6k
  • 2
  • 45
  • 61

Windows Batch, 204

set a=0
:a
set /p i=^>^> 
if %i%==i set a=%a%+1
if %i%==x set a=%a%+1
if %i%==d set a=%a%-1
if %i%==s set a=%a%*%a%
if %i%==k set a=%a%*%a%
if %i%==o echo %a%
if %i%==c echo %a%
if %a%==256 set a=0
goto a

Successfully ignores other commands. Really got bloated without having or to work with...