Reverse It v1.0.8

Introduction

This is a very simple Perl script which basically creates a return path for directions given. You can use any separator which you choose. I tend to use a semi-colon because it's an easy separator and many sites out there give you dirs with that separator.

Downloading

You can download the source from www.zombii.org. It has been downloaded 81 times.

Installing

This script was written for Perl which can be obtained from www.perl.org. If you are using a Unix system you should make sure that you have Perl installed in your PATH. This script should work on Windows but you're on your own there as to how you set that up.

Usage

$ ./reverse.pl --help
usage: reverse.pl <separator> <path>

Example

$ ./reverse.pl ';' '3 n;2 w;s;u'
d;n;2 e;3 s

TinyFugue Example

The following is a small macro which will let you pull the reverse paths directly from tf.

;;
;; Reverse path
;;
/def reverse_path = \
  /let _dirs=$[replace('"', '', replace('\'', '', {*}))]%; \
  /let _reverse=$(/quote -S /_echo !/path/to/reverse.pl' ";" "%{_dirs}")%; \
  /_echo Reverse of %{_dirs} --> $(/escape ' %{_reverse})'

You can test out the new macro with the following:

/reverse_path 3 n;2 w;s;u
Reverse of 3 n;2 w;s;u --> d;n;2 e;3 s

Known Issues

This tool does not work with odd exits. It has the basic cardinal directions coded in, but after that, it will just leave a placeholder which you need to manually fill in.