Git Product home page Git Product logo

pypen's People

Contributors

erianoirp avatar watayan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pypen's Issues

「(配列変数)に(配列)を連結する」が動作しない

a=[0,1,2,3,4,5]
aに6を追加する
aに[7,8]を連結する

これはPyPENの文法マニュアルから引っ張ってきたものです。
これを実行すると、aが[0,1,2,3,4,5,6,7,8]になると私は考えていましたが、実際に実行すると以下のエラーが発生して強制終了してしまいます。

実行時エラーです
3行目:配列でない値を連結することはできません

※実行環境: https://watayan.net/prog/PyPEN/

初期化されていない変数のあり方

今は初期化されていない変数を読み出すと適当に0とか空文字列になるようにしているが,これを禁止したい(NullValueを廃止する)。それと同時に,配列も長さを超えてなにかしようとしたときにはエラーにし,その代わりappendやextendにあたるものを実装する。

以下のコードでぬるぽが出る

#設定
atari=7 #あたりの設定
play1=100 #1プレイあたりの購入金額
#プレイ回数の処理
表示する("福引きゲームをしましょう")
表示する("今日は何円お買い上げでしたか?")
moneyに整数を入力する
play=money//play1 #プレイ回数の計算
表示する("今日は"とplayと"回挑戦できます")
#福引きゲームの処理
i=1
i<=playの間:
#入力
表示する(iと"回目の挑戦!")
表示する("1から10までの好きな数字を入力してください")
userに整数を入力する
#判定・出力
もしuser==atariならば:
表示する("あたり!")
表示する("さすがです!!")
繰り返しを抜ける
そうでなくもしuser<atariならば:
表示する("残念でした…あたりはもっと大きいです")
表示する("また挑戦してね")
そうでなければ:
表示する("残念でした…あたりはもっと小さいです")
表示する("また挑戦してね")
i=i+1

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.