Skip to content

Commit

Permalink
1章〜3章 の問題番号と種類の設定
Browse files Browse the repository at this point in the history
  • Loading branch information
Takeno-hito committed May 2, 2024
1 parent e14d137 commit 1b76136
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 66 deletions.
32 changes: 29 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ export default withMermaid({
items: [
{ text: 'コンパイルとOS', link: '/text/chapter-1/compile-os' },
{ text: 'ターミナルの扱い', link: '/text/chapter-1/terminal' },
{ text: '練習問題', link: '/text/chapter-1/practice/' },
{
text: '練習問題',
link: '/text/chapter-1/practice/',
collapsed: true,
items: [
{ text: '1-B1. はじめてのプログラミング nano 編', link: '/text/chapter-1/practice/nano-test' },
{ text: '1-C1. Hello shell', link: '/text/chapter-1/practice/hello-shell' },
],
},
],
},
{
Expand All @@ -69,7 +77,15 @@ export default withMermaid({
{ text: 'はじめてのプログラミング解説', link: '/text/chapter-2/hello-world' },
{ text: 'int 変数', link: '/text/chapter-2/variables' },
{ text: '変数の入力', link: '/text/chapter-2/input' },
{ text: '練習問題', link: '/text/chapter-2/practice/' },
{
text: '練習問題',
link: '/text/chapter-2/practice/',
collapsed: true,
items: [
{ text: '2-A1. Multiplication', link: '/text/chapter-2/practice/multiplication' },
{ text: '2-B1. 4bit', link: '/text/chapter-2/practice/4bit' },
],
},
]
},
{
Expand All @@ -78,7 +94,17 @@ export default withMermaid({
items: [
{ text: '条件分岐', link: '/text/chapter-3/if-else' },
{ text: '型', link: '/text/chapter-3/type' },
{ text: '練習問題', link: '/text/chapter-3/practice/' },
{
text: '練習問題',
link: '/text/chapter-3/practice/',
collapsed: true,
items: [
{ text: '3-A1. Echo', link: '/text/chapter-3/practice/echo' },
{ text: '3-A2. Fraction', link: '/text/chapter-3/practice/fraction' },
{ text: '3-B1. int128', link: '/text/chapter-3/practice/int128' },
{ text: '3-B2. De Morgan\'s laws', link: '/text/chapter-3/practice/de-morgans-laws' },
]
},
]
},
{
Expand Down
2 changes: 2 additions & 0 deletions docs/text/chapter-0/guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

そして 4 つめ、ゲームを作るにしろ何をするにしろ、「プログラミング」そのものを無視して先に進むことは難しいです。現在はプログラミングをせずともゲームを作れるような仕組みがたくさんありますが、自分の想像通りに作ろうとするとやはりプログラミングの知識は必要になるでしょう。

現在では全てのプログラミング系の班で、このプログラミング基礎講習の受講を推奨しています。そのため内容もどの班に行っても問題なく役に立つ内容になっていますので、ぜひ C++ を習得してください。

----

本講習の目的は、大きく分けて2つです。
Expand Down
2 changes: 1 addition & 1 deletion docs/text/chapter-0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ next: { text: '講習会ガイダンス', link: 'text/chapter-0/guidance' }
* 自由に使えるメモ帳が出てくる
* 新しい行に `## aaa` と書くと…?
* いろんな使い方があります。[「君の知らないtraP HackMDの世界」](https://md.trap.jp/vjjW5mXQStCgv_h8PhYF1A) を見てみましょう
:::
:::
2 changes: 1 addition & 1 deletion docs/text/chapter-1/practice/hello-shell.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hello shell
# 2-C1. Hello shell

ターミナル (シェル) のファイルを検索するコマンド、 `find` コマンドで遊んでみましょう。

Expand Down
4 changes: 2 additions & 2 deletions docs/text/chapter-1/practice/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
おまけ問題たちです 解けなくても OK
:::

- [はじめてのプログラミング nano 編](nano-test)
- [Hello shell](hello-shell)
- [1-B1. はじめてのプログラミング nano 編](nano-test)
- [1-C1. Hello shell](hello-shell)
17 changes: 9 additions & 8 deletions docs/text/chapter-1/practice/nano-test.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# はじめてのプログラミング nano 編
# 2-B1. はじめてのプログラミング nano 編

今の操作はすべてターミナル上で完結させることもできる。ここでは少しだけそれを試してみよう。
さきほどの操作はすべてターミナル上で完結させることもできる。ここでは少しだけそれを試してみよう。

::: info
ここで紹介するのは「できる」というだけでの紹介で、本講習中では VSCode を使うことを強くおすすめします!
Expand All @@ -9,12 +9,13 @@
1. 「作業環境を開く方法」まで一緒
2. `nano nano-test.cpp` でコードを開く
3. キーを入力すると色々入力できる。
4. `Ctrl + X`で終了
5. `y`を入力したあと、`Enter`を押すと保存
6. `ls`コマンドで`nano-test.cpp`があることを確認
7. ターミナル上で、`clang++ nano-test.cpp` で「コンパイル」
8. エラーが出なかったら、 `./a.out` で「実行」
9. できた!
4. ソースコードを入力する。
5. `Ctrl + X`で終了
6. `y`を入力したあと、`Enter`を押すと保存
7. `ls`コマンドで`nano-test.cpp`があることを確認
8. ターミナル上で、`clang++ nano-test.cpp` で「コンパイル」
9. エラーが出なかったら、 `./a.out` で「実行」
10. できた!

この方法で、次のソースコードからなる `nano-test.cpp` を作成してみよう。

Expand Down
39 changes: 0 additions & 39 deletions docs/text/chapter-1/practice/sample.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/text/chapter-2/practice/4bit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 2-xx. 4bit
# 2-B1. 4bit

入力から$0 <= n < 16$の整数値を受け取り、2進数で表記しよう。

Expand Down
6 changes: 2 additions & 4 deletions docs/text/chapter-2/practice/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# 練習問題 - Chapter 2

- [Echo](echo)
- [Multiplication](multiplication)
- [int128](int128)
- [4bit](4bit)
- [2-A1. Multiplication](multiplication)
- [2-B1. 4bit](4bit)
2 changes: 1 addition & 1 deletion docs/text/chapter-2/practice/multiplication.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 2-xx. Multiplication
# 2-A1. Multiplication

cinでint型の整数を2つ受け取って、その積をターミナルに出力しよう。

Expand Down
3 changes: 2 additions & 1 deletion docs/text/chapter-3/practice/de-morgans-laws.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# De Morgan's laws
# 3-B2. De Morgan's laws

`bool`型の値`P``Q`が与えられるので、ド・モルガンの法則が成り立つことを実際に確かめよう。

::: tip ド・モルガンの法則
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 2-xx. Echo
# 3-A1. Echo

入力から単語を1つ受け取り、それを出力しよう。

Expand Down
2 changes: 1 addition & 1 deletion docs/text/chapter-3/practice/fraction.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 3-xx. Fraction
# 3-A2. Fraction

入力から整数$a,b,c,d$を受け取り、$a/b+c/d$を計算して、存在するなら分数`n/d`として表示しよう。
### 入出力例 1
Expand Down
6 changes: 4 additions & 2 deletions docs/text/chapter-3/practice/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 練習問題 - Chapter 3

- [De Morgan's laws](de-morgans-laws)
- [Fraction](fraction)
- [3-A1. Echo](echo)
- [3-A2. Fraction](fraction)
- [3-B1. int128](int128)
- [3-B2. De Morgan's laws](de-morgans-laws)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 2-xx. int128
# 3-B1. int128

入力からint型の非負整数値を1つ受け取り、$10^{25}$倍して出力しよう。

Expand Down

0 comments on commit 1b76136

Please sign in to comment.