Skip to content

Instantly share code, notes, and snippets.

@grevych
Last active September 24, 2021 09:47
Show Gist options
  • Save grevych/2b353a9302b715f57084b7564519d131 to your computer and use it in GitHub Desktop.
Save grevych/2b353a9302b715f57084b7564519d131 to your computer and use it in GitHub Desktop.

Revisions

  1. grevych revised this gist Sep 24, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions funo.rkt
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,7 @@
    (cond
    [(empty? L) 1]
    [(equal? (length L) 1) (FUNO(first L))]
    [else
    (* (FUNO(first L)) (FUNO (rest L)))
    ]
    [(* (FUNO(first L)) (FUNO (rest L)))]
    )
    ]
    [else L]
  2. grevych created this gist Sep 24, 2021.
    16 changes: 16 additions & 0 deletions funo.rkt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    (define (FUNO L)
    (cond
    [(list? L)
    (cond
    [(empty? L) 1]
    [(equal? (length L) 1) (FUNO(first L))]
    [else
    (* (FUNO(first L)) (FUNO (rest L)))
    ]
    )
    ]
    [else L]
    )
    )

    (write(FUNO '(10 (8 (1) (1)) (20 (1) (1)))) ) #1600