I'd like to sketch out some pseudocode and then share it with other people that won't be using emacs.

Is there a nice way to do this? I'm trying to do it in org-mode, but it's not indenting properly, etc...

  • Someone has written a pseudocode-mode, but as of this writing it only offers syntax highlighting, no indentation. – dsedivec Sep 22 at 20:22

I don't know of a pseudo-code mode, less so support for that in org-mode.

You can, however, write pseudo-code in #+BEGIN_EXAMPLE blocks, surely without indentation, or you decide for a true language as base syntax and pseudo-code in that and get indentation and pretty syntax highlighting. Ruby might be a good candidate, or good old C/C++, maybe Java...

This is how it could look like:

#+HEADER: :exports both :results output
#+BEGIN_SRC ruby
class Pseudoclass
  def pseudofunction(items)
    add five to each item

pseudoinstance = new Pseudoclass instance
call pseudofunction of pseudoinstance with list 2, 3, 4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.