Giter Site home page Giter Site logo

btholt / tryocaml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ocamlpro/tryocaml

0.0 3.0 0.0 64.3 MB

An interactive tutorial to begin learning with OCaml

Home Page: try.ocamlpro.com

Makefile 0.04% OCaml 2.71% HTML 0.66% JavaScript 96.52% CSS 0.07%

tryocaml's Introduction

Overview

TryOCaml is the easiest way to learn how to code in OCaml language. A funny way to learn the language. It is available here:

http://try.ocamlpro.com/

TryOCaml is based on (http://ocsigen.org/js_of_ocaml/files/toplevel/index.html) built with js_of_ocaml (see http://ocsigen.org/js_of_ocaml/).

Requirements

Try it

$ opam remote add devel [email protected]:OCamlPro/opam-repo-dev.git
$ opam install js_of_ocaml.100
$ git submodule init
$ git submodule update
$ ./configure
$ make

Then, with your favorite browser launch tryocaml/index.html:

$ chromium-browser tryocaml/index.html

Contribute lessons/steps/fixes

Lessons are in the "lessons/" top directory.

Each lesson is a sub-directory "lessonN", where N is the lesson number, and contains a file "lesson.html", with a title in a <h3> tag on the first line, and a set of steps. Each step is a sub-directory "stepM" of "lessons/lessonN", where M is the step number in the lesson.

Each step is composed of two files:

  • "step.html": the text of the step. The first line MUST contain the step title, in a <h3> tag. Code that should be copied in the terminal should be in <code> tags.
  • "step.ml": the function testing if the step has been completed. It takes the user input (a string) and the compiler output (a string) as arguments, and returns a boolean, true if the user has succeeded, false otherwise. "step.ml" can directly use functions defined in "lessons/goodies.ml" (that is included, so NEVER use "open Goodies" or "Goodies.something), in particular the "find_in" function.

To recompile when you have done a modification:

$ make update-lessons

Failure to comply to the lesson/step specification will make the tryocaml/tutorial/make_lessons command fail.

If you want to debug at some point, you can type debug true in the terminal to see what the input and output strings are.

Once everything works, send a "pull request" via Github, or send us a patch. You can also come on #ocamlpro IRC channel to discuss with us.

Online

http://try.ocamlpro.com/

License

[GNU General Public License] (https://github.com/OCamlPro/tryocaml/blob/master/tryocaml/LICENSE.GPL)

tryocaml's People

Contributors

cagdasbozman avatar lefessan avatar samoht avatar thelema avatar rixed avatar joaosa avatar btholt avatar gasche avatar thomashuet avatar

Watchers

James Cloos avatar  avatar  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.