Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
FROM hexletbasics/base-image:latest

# TODO: replace exercises-template with "exercises-<language>"
WORKDIR /exercises-template
RUN apt-get update && apt-get install -y fpc

# https://github.com/pgrange/bash_unit
RUN cd /usr/local/bin && curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh | bash
WORKDIR /exercises-pascal

COPY . .

# TODO: replace
ENV PATH=/exercises-template/bin:$PATH
ENV PATH=/exercises-pascal/bin:$PATH
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ compose-code-lint:
docker-compose run exercises make code-lint

code-lint:
# TODO: add linter
echo "code-lint"

compose-description-lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Description

The template repository contains the exercise `Hello, World!` and the basic structure for all exercise repos. Use the `make find-todo` command to find a template code to replace for your language
Free introductory Pascal course. It starts with the classic `Hello, World!` exercise and covers the basics of the language.

## How to contribute

Expand Down
14 changes: 11 additions & 3 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/bin/env bash
# TODO: add test run
bash_unit test_index.sh
#!/usr/bin/env bash

fpc -v0 index.pas >/dev/null 2>&1 || { echo "Compilation failed"; exit 1; }

actual=$(./index)
expected="Hello, World!"

if [ "$actual" != "$expected" ]; then
echo "Expected '$expected', but got '$actual'"
exit 1
fi
3 changes: 1 addition & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ version: '3'
services:
exercises:
volumes:
# TODO: replace exercises-template with "exercises-<language>"
- ".:/exercises-template"
- ".:/exercises-pascal"
30 changes: 21 additions & 9 deletions modules/10-basics/10-hello-world/description.ru.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
---
# TODO: replace
name: Привет, Мир!

name: Первая программа на Pascal
theory: |
По традиции начнем с написания программы 'Hello, World!'. Эта программа будет выводить на экран текст:
Изучать язык программирования, по традиции, начинают с программы 'Hello, World!'.

```sh
echo 'Hello, World!'
```text
Hello, World!
```

instructions: |
В языке Pascal эта программа будет выглядеть так:

```pascal
begin
writeln('Hello, World!');
end.
```

Текст `Hello, World!` появится на экране благодаря процедуре `writeln`.

instructions: |
Наберите в редакторе код из задания символ в символ и нажмите «Проверить».

```sh
echo 'Hello, World!'
```pascal
writeln('Hello, World!');
```

tips: []
> Внимание: если вы напишете `heLLo, woRld!` вместо `Hello, World!`, то это будет считаться другим текстом, потому что заглавные и строчные буквы — это разные символы. Размер буквы называют *регистром*, и говорят: **регистр — важен!** Это касается почти всего в коде, поэтому привыкайте всегда обращать внимание на регистр.

tips:
- "Если в редакторе есть запись `// BEGIN` и `// END`, то код нужно писать между этими строчками."
7 changes: 7 additions & 0 deletions modules/10-basics/10-hello-world/index.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
program HelloWorld;

begin
// BEGIN
writeln('Hello, World!');
// END
end.
5 changes: 0 additions & 5 deletions modules/10-basics/10-hello-world/index.sh

This file was deleted.

7 changes: 4 additions & 3 deletions modules/10-basics/10-hello-world/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

Наберите в редакторе код из задания символ в символ и нажмите «Проверить».

```sh
echo 'Hello, World!'
```pascal
writeln('Hello, World!');
```

> Внимание: если вы напишете `heLLo, woRld!` вместо `Hello, World!`, то это будет считаться другим текстом, потому что заглавные и строчные буквы — это разные символы. Размер буквы называют *регистром*, и говорят: **регистр — важен!** Это касается почти всего в коде, поэтому привыкайте всегда обращать внимание на регистр.
16 changes: 13 additions & 3 deletions modules/10-basics/10-hello-world/ru/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
По традиции начнем с написания программы 'Hello, World!'. Эта программа будет выводить на экран текст:
Изучать язык программирования, по традиции, начинают с программы 'Hello, World!'.

```sh
echo 'Hello, World!'
```text
Hello, World!
```

В языке Pascal эта программа будет выглядеть так:

```pascal
begin
writeln('Hello, World!');
end.
```

Текст `Hello, World!` появится на экране благодаря процедуре `writeln`.
7 changes: 5 additions & 2 deletions modules/10-basics/10-hello-world/ru/data.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
name: Привет, Мир!
tips: []
name: Первая программа на Pascal
tips:
- >-
Если в редакторе есть запись `// BEGIN` и `// END`, то код нужно писать между
этими строчками.
5 changes: 5 additions & 0 deletions modules/10-basics/10-hello-world/test.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
program HelloWorld;

begin
writeln('Hello, World!');
end.
9 changes: 0 additions & 9 deletions modules/10-basics/10-hello-world/test_index.sh

This file was deleted.

6 changes: 3 additions & 3 deletions modules/10-basics/description.ru.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# TODO: replace
name: Основы Bash

name: Основы Pascal
description: |
Описание
Pascal — процедурный язык программирования со строгой типизацией, созданный для обучения структурному программированию. Простой и наглядный синтаксис делает его удобным для знакомства с азами разработки. В первом модуле познакомимся с основами языка.
14 changes: 9 additions & 5 deletions spec.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---

language:
# TODO: replace exercises-template with "exercises-<language>"
docker_image: "ghcr.io/hexlet-basics/exercises-template"
extension: sh # TODO: replace
exercise_filename: index.sh # TODO: replace
exercise_test_filename: test_index.sh # TODO: replace
docker_image: "ghcr.io/hexlet-basics/exercises-pascal"
extension: pas
exercise_filename: index.pas
exercise_test_filename: test.pas
learn_as: first_language
progress: in_development
name: Pascal
Loading