emojicode / emojicode

πŸ˜€πŸ˜œπŸ”‚ World’s only programming language that’s bursting with emojis
https://emojicode.org
Artistic License 2.0
3.26k stars 161 forks source link

How to pause program execution? #200

Closed benmor20 closed 2 years ago

benmor20 commented 2 years ago

⭐️ Proposed change

How do you pause the program execution? I'm looking for something similar to sleep(1000).

πŸ€” Rationale

I found a previous issue that mentions pausing the execution using πŸ©β²πŸ’ˆ but this does not seem to work for me even in the most basic tests:

🏁 πŸ‡
  πŸ©β²πŸ’ˆ 1000000  πŸ’­ Wait one second
πŸ‰

When I run emojicodec test.emojic I get:

test.emojic:3:1: 🚨 error: Unexpected token BlockEnd.
πŸ‰β¬†οΈ

test.emojic:3:1: 🚨 error: Unexpected end of program.
πŸ‰β¬†οΈ
thbwd commented 2 years ago

This is just a class method call, but in a very old syntax. The correct syntax is now:

🏁 πŸ‡
  β²πŸ‡πŸ’ˆ 1000000  β—οΈπŸ’­ Wait one second
πŸ‰

See https://www.emojicode.org/docs/packages/s/1f9f5.html#s.class_1f9f5.type.23f2-s.vt_1f522 and https://www.emojicode.org/docs/reference/classes-valuetypes.html#methods