Archived
1
1
Fork
You've already forked scratchimg
0
Generate pixel art of Scratch blocks.
This repository has been archived on 2025年10月01日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 100%
2024年04月26日 22:58:56 +05:30
examples Update README.md and pyproject.toml 2024年04月26日 22:58:56 +05:30
fonts Add new files and update dependencies 2024年04月26日 19:08:04 +05:30
src/scratchimg add c min height 2024年04月26日 22:53:04 +05:30
.gitignore Add new files and update dependencies 2024年04月26日 19:08:04 +05:30
.python-version Add new files and update dependencies 2024年04月26日 19:08:04 +05:30
pyproject.toml Update README.md and pyproject.toml 2024年04月26日 22:58:56 +05:30
README.md Update README.md and pyproject.toml 2024年04月26日 22:58:56 +05:30
requirements-dev.lock add c min height 2024年04月26日 22:53:04 +05:30
requirements.lock add c min height 2024年04月26日 22:53:04 +05:30

scratchimg

Create pixel art of Scratch blocks in Python.

stack = Stack(
 [
 Block(
 styles["motion"],
 ["move", Literal("10"), "steps"],
 ),
 Block(
 styles["looks"],
 ["say", Literal("Hello!"), "for", Literal("2"), "seconds"],
 ),
 Block(
 styles["sound"],
 ["clear sound effects"],
 ),
 Block(
 styles["events"],
 ["broadcast", Menu("message1")],
 ),
 Block(
 styles["control"],
 ["wait", Literal("1"), "seconds"],
 ),
 Block(
 styles["sensing"],
 ["ask", Literal("What's your name?"), "and wait"],
 ),
 Block(
 styles["variables"],
 [
 "set",
 Literal("my variable"),
 "to",
 Boolean(
 styles["operators"],
 [Literal("10"), "<", Literal("20")],
 ),
 ],
 ),
 Block(
 styles["lists"],
 ["add", Literal("thing"), "to", Menu("my list")],
 ),
 Block(
 styles["custom"],
 [
 "custom block",
 Reporter(
 styles["sensing"],
 ["mouse x"],
 ),
 ],
 ),
 C(
 styles["control"],
 [
 "if",
 Boolean(styles["operators"], [Literal("A"), "=", Literal("a")]),
 "then",
 ],
 Stack([]),
 ),
 ]
)
c = C(
 styles["control"],
 ["if", Boolean(styles["operators"], [Literal("A"), "=", Literal("a")]), "then"],
 stack,
)