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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This repository uses mainly Japanese, pull requests in English are also welcome.
- ただし命名について、pascal-case/camel-case/snake-case/kebab-caseなどのcasingに関しては、その言語での標準・慣習に従うように変更してかまいません。
- shebang・ディレクティブ・初期化処理や標準入出力等、その言語に特有・必須な部分については、そのまま記述してください。

他言語へ移植する際に追加・変更すべきファイルとその内容については、[PR #9](/../../pull/9)を参照してください。
他言語へ移植する際に追加・変更すべきファイルとその内容については、[PR #17 (PowerShellの例)](/../../pull/17)および[PR #9 (C++の例)](/../../pull/9)を参照してください。

## Unacceptable changes / 受け入れられない変更
[リポジトリの目的](#リポジトリの目的)から逸脱するような変更は受け入れられません。 例として、以下のような変更はお断りします。
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [C#](src/impls/csharp/)
- [Java](src/impls/java/)
- [JavaScript](src/impls/javascript/)
- [PowerShell](src/impls/powershell/)
- [Python 3](src/impls/python/)
- [Visual Basic](src/impls/visualbasic/)
<!-- [Ruby](src/impls/ruby/) -->
Expand Down
5 changes: 5 additions & 0 deletions src/impls/powershell/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# EditorConfig is awesome: https://EditorConfig.org

[*.ps1]
indent_style = space
indent_size = 2
18 changes: 18 additions & 0 deletions src/impls/powershell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[二分木を使った数式の逆ポーランド記法化と計算](https://smdn.jp/programming/tips/polish/)のPowerShellでの実装。

# 前提条件
[PowerShell](https://learn.microsoft.com/ja-jp/powershell/scripting/overview) 7.1以降が必要です。

# ビルドおよび実行
スクリプトを直接実行し、式を入力することにより、入力された式に対して逆ポーランド記法化・計算を行うことができます。

実行例:
```sh
$ ./polish.ps1
input expression: 2 + 5 * 3 - 4
expression: 2+5*3-4
reverse polish notation: 2 5 3 * + 4 -
infix notation: ((2 + (5 * 3)) - 4)
polish notation: - + 2 * 5 3 4
calculated result: 13
```
Loading