-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from usernaimandrey/first-exercise
firs exercise
- Loading branch information
Showing
15 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/**/_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/**/logs/ | ||
*.DS_Store | ||
|
||
_build | ||
*.byte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,17 @@ | ||
FROM hexletbasics/base-image:latest | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get install -y opam | ||
|
||
RUN opam init -y --disable-sandboxing | ||
|
||
RUN opam install alcotest.1.6.0 -y | ||
|
||
RUN eval $(opam config env) | ||
|
||
WORKDIR /exercises-ocaml | ||
|
||
COPY . . | ||
|
||
ENV PATH=~/.local/bin/:/exercises-ocaml/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
eval $(opam config env) | ||
ocamlbuild -pkg alcotest test.byte | ||
./test.byte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
title: 'Course in OCaml (okaml): free lessons, training online' | ||
|
||
header: | | ||
Code Basics - this is a completely free online programming course! | ||
description: | | ||
OCaml is an object-oriented language of general purpose functional programming. It was designed with safety in mind and the reliability of the program. Supports functional, imperative and object-oriented programming paradigms. The most widespread dialect of the ML language in practical work. | ||
seo_description: | | ||
OCaml (okaml) programming training from scratch, a free online course from the Hexlet community. OCaml (okaml) programming lessons for beginners. | ||
keywords: | ||
- code basics | ||
- online courses | ||
- free courses | ||
- programming | ||
- OCaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
|
||
title: 'Курс по OCaml (окамл): бесплатные уроки, обучение онлайн' | ||
|
||
header: | | ||
Code Basics - это полностью бесплатные онлайн курсы по програмированию! | ||
description: | | ||
OCaml — объектно-ориентированный язык функционального программирования общего назначения. Был разработан с учётом безопасности исполнения и надёжности программ. Поддерживает функциональную, императивную и объектно-ориентированную парадигмы программирования. Самый распространённый в практической работе диалект языка ML. | ||
seo_description: | | ||
Обучение программированию на OCaml (окамл) с нуля, бесплатный курс онлайн от сообщества Хекслет. Уроки программирования на OCaml (окамл) для начинающих | ||
keywords: | ||
- code basics | ||
- онлайн курсы | ||
- бесплатные курсы | ||
- програмирование | ||
- OCaml | ||
- окамл |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
--- | ||
|
||
name: Привет, Мир! | ||
name: Первая программа на OCaml | ||
theory: | | ||
Изучать язык программирования, по традиции, начинают с программы 'Hello, World!', которая выводит этот текст на экран. | ||
Изучать язык программирования, по традиции, начинают с программы 'Hello, World!'. | ||
<pre class='hexlet-basics-output'> | ||
Hello, World! | ||
</pre> | ||
В языке OCaml эта программа будет выглядеть например так: | ||
```ocaml | ||
let message = "Hello, World!";; | ||
let hello () = print_endline message;; | ||
``` | ||
Текст `Hello, World!` появится на экране благодаря команде `print_endline message;;`. | ||
Такая команда выводит на экран информацию, которая указана после директивы `print_endline`. | ||
instructions: | | ||
Наберите в редакторе код из задания символ в символ и нажмите «Проверить». | ||
```ocaml | ||
let message = "Hello, World!";; | ||
let hello () = print_endline message;; | ||
``` | ||
> Внимание: если вы напишете `heLLo, woRld!` вместо `Hello, World!`, то это будет считаться другим текстом, потому что заглавные и строчные буквы — это разные символы. Размер буквы называют *регистром*, и говорят: **регистр — важен!** Это касается почти всего в коде, поэтому привыкайте всегда обращать внимание на регистр. | ||
tips: | ||
- "Если в редакторе есть запись `(* BEGIN *)` и `(* BEGIN *)`, то код нужно писать между этими строчками." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(* BEGIN *) | ||
let message = "Hello, World!";; | ||
let hello_world () = print_endline message;; | ||
(*END*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
val message : string | ||
val hello_world : unit -> unit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
open Index | ||
|
||
|
||
let test_hello_world () = | ||
Alcotest.(check string) "greating string" "Hello, World!" (message) | ||
|
||
|
||
let () = | ||
let open Alcotest in | ||
run "Utils" [ | ||
"greating string", [ | ||
test_case "greating run" `Quick test_hello_world; | ||
]; | ||
] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
--- | ||
name: Основы | ||
description: | | ||
Описание | ||
OCaml – Был разработан с учётом безопасности исполнения и надёжности программ. Появился в 1996 году под названием Objective Caml и только 2011 был переименован в OСaml. В этом модуле мы познакомимся с основыми OСaml и напишем первую программу. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
|
||
language: | ||
docker_image: "hexletbasics/exercises-typescript" | ||
extension: ts | ||
exercise_filename: index.ts | ||
exercise_test_filename: test.ts | ||
docker_image: "hexletbasics/exercises-ocaml" | ||
extension: ml | ||
exercise_filename: index.ml | ||
exercise_test_filename: test.ml |