Skip to content

Instantly share code, notes, and snippets.

@jdriordan
Last active February 11, 2021 13:00
Show Gist options
  • Select an option

  • Save jdriordan/4a373e39f5a7ef1f900fc4d50b1ed20c to your computer and use it in GitHub Desktop.

Select an option

Save jdriordan/4a373e39f5a7ef1f900fc4d50b1ed20c to your computer and use it in GitHub Desktop.

Revisions

  1. jdriordan revised this gist Feb 11, 2021. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions sqrt.fs
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    !# /usr/bin/gforth
    #! /usr/bin/gforth

    : sq dup * ;
    : is_sqrt? over sq - >= ;
    : sqrt 1 begin 1+ 2dup swap is_sqrt? until ;

    ." Hello World" cr
    bye

  2. jdriordan created this gist Jun 12, 2017.
    8 changes: 8 additions & 0 deletions sqrt.fs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    !# /usr/bin/gforth

    : sq dup * ;
    : is_sqrt? over sq - >= ;
    : sqrt 1 begin 1+ 2dup swap is_sqrt? until ;

    ." Hello World" cr
    bye