Coder Social home page Coder Social logo

bl33h / fibonacciandfactorial Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 4 KB

A project that includes two LISP programs: one for factorials and the other for Fibonacci sequences. They use recursion, prompt user input, and display results efficiently.

Common Lisp 100.00%
factorial factorial-calculation fibonacci fibonacci-sequence lisp recursion

fibonacciandfactorial's Introduction

fibonacciAndFactorial

The code includes two programs written in LISP: one calculates factorials and the other generates Fibonacci sequences. The factorial program uses recursion to compute the factorial of a given number, while the Fibonacci program recursively generates the Fibonacci sequence. Both programs prompt the user for input, perform the calculations, and display the results. They provide efficient solutions for factorial computation and Fibonacci sequence generation in LISP.


pic

FilesFeaturesHow To Use

Files

  • fact.lsp: file that implements the factorial solution.
  • fib.lsp: file that implements the fibonacci solution.

Features

The main features of the application include:

  • Factorial Calculation: The code implements a recursive function to calculate the factorial of a given number.
  • Fibonacci Sequence Generation: The code includes a recursive function to generate the Fibonacci sequence up to a given number.
  • User Input: The programs prompt the user to enter a number for which the factorial or Fibonacci sequence is to be computed.
  • Output Display: The code displays the computed factorial or Fibonacci sequence as the output.
  • Reusability: The factorial and Fibonacci functions can be reused in other LISP programs that require similar calculations.
  • Modular Design: The code follows a modular design with separate functions for factorial and Fibonacci calculations, promoting code organization and reusability.

How To Use

To clone and run this application, you'll need Git and a Lisp interpreter or compiler installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/bl33h/fibonacciAndFactorial

# Open the folder
$ cd src

# Run de app
$ lisp
$ load "fact.lsp"
$ load "fib.lsp"

Note: to execute the code, it's important that run only on this location

fibonacciandfactorial's People

Contributors

bl33h avatar fabianjuarez182 avatar thekiesling avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.