Skip to content

Instantly share code, notes, and snippets.

@garretraziel
Created April 13, 2010 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garretraziel/364848 to your computer and use it in GitHub Desktop.
Save garretraziel/364848 to your computer and use it in GitHub Desktop.
#! /usr/bin/gst -f
Object subclass: Automat [
oddelejMezery: soubor uloz: soubor2[
|vstup vystup retezec|
vystup:=FileStream open: soubor2 mode: FileStream write.
vstup:=FileStream open: soubor mode: FileStream read.
[ vstup atEnd ] whileFalse: [
retezec := vstup upTo: Character space.
vystup nextPutAll: retezec.
].
vystup close.
vstup close.
]
]
Transcript show: 'Cesta k prvnimu: '.
soubor1:=stdin nextLine.
Transcript show: 'Cesta kam ulozit: '.
soubor2:=stdin nextLine.
Automat new oddelejMezery: soubor1 uloz: soubor2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment