GithubHelp home page GithubHelp logo

scratch2cpp's People

Contributors

snuke avatar yos1up avatar yumetodo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

yumetodo snuke

scratch2cpp's Issues

support integer

とはいっても double 型でも 2^53 までは整数を正確に扱えるのでそれで良い?

Convert to JS?

C++ に変換するよりも JS に変換する方が簡潔な処理で済みそうであり,かつ生成されるコードも簡潔になりそう

日本語変数名

Scratch プロジェクト上で日本語の変数名が使われている場合,現状はそのままC++コード上でも日本語変数名で出力されます.これは,変換後のC++コードと元の Scratch プロジェクトを見比べるのを容易にするためにそういう仕様にしているのですが,日本語文字が変数名に含まれていると g++ ではコンパイルできなくなるというデメリットがあります.そして,経験的に G++ よりも Clang の方が TLE しやすいです.(例:ABC049C, ABC122C)

そこで,日本語変数名も適宜英数字列の変数名に変換することで g++ コンパイル可能なコードを吐くように仕様変更する方が良いかもしれない?と思っています.

0で始まる文字列

Scratch editor 上でテキストボックスに「0431」と直打ちされたものは,C++に変換すると Var(0431) というソースになりますが,これは C++ の言語規約上 Var(281) と等価な意味になってしまいます(0で始まる文字列リテラルは8進数として扱われる).これを避けるために,ナイーブには Var("0431") というソースに変換するという方法が考えられます.しかし,これで十分でしょうか?

大文字小文字の区別

Scratch では区別しないようですが,現 Scratcher's AtCoder では区別します.競プロ的には区別された方が嬉しい場面の方が多いと思うので,今のところこの仕様を変える予定はないです.

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.