Nepeo's Recent Forum Activity

  • I've looked at the shunting yard algorithm in the past, but never actually implemented it. Most of the stuff I've looked at has been for generating ASTs for programming languages, which it isn't suited for. While the algorithms are quite different conceptually it's similar to how pratt parsing deals with precedence, but using explicit stacks instead of the call-stack.

    When working with recursive descent and a mathematical expression you don't really need to create the tree nodes, you can just evaluate each node as you reach it and return the value instead. Avoids the type limitations in construct.

    When you create an "app" on admob you select a platform, then you get an app ID for that platform. You can see on the left that you have selected Android.

    If you create another "app" on admob for iOS it will have a different app ID.

    Abhishek Thapliyal please read the manual page, it explains what a publisher ID is and where to find it. The TEST keyword is a legacy feature that was removed some time ago, I realised this morning that there was still a reference to it in the manual page so I removed it.

    The TEST keyword was basically a substitute for the example Admob ID values, but Admob considers them a special case and hence they often work when a real Ad unit ID wouldn't. Making them pretty useless for testing.

    Abhishek Thapliyal

    if you choose an invalid value for your app ID the application will be crashed by the SDK on startup

    It's a requirement by the SDK, it will not get your account banned. What the documentation says is that you should use testing mode with adverts during development. If you do not use testing mode then you will see real adverts that Admob are charging some company for, hence why they consider it a ban-able offense. Testing adverts will have a small label at the top that says "test ad", if you do not see this close the application immediately and rebuild it with test mode enabled. They are normally lenient if you see 1 or 2 by accident

  • Good point by if you do need to check the count I'd advise that you use greater than or less than where possible instead of checking for equality in most situations. Helps if you make a bad assumption on the possible range of a value or you fall foul of floating point error.

  • New instances don't appear to forEach and similar lookups until the next tick.

    Try adding in a "wait 1" before calling the "location" function.

  • Yeah we concluded it's probably an obscure caching bug, I've tried a few tricks to try and fix it but haven't had much luck. It doesn't look like it's synced to any of the servers though so refreshing isn't going to fix it. Your probably best off re-posting it.

  • macube I don't see your post either, but it does show up on reply. I'll talk to Tom.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • By the sounds of it you just want an app that can give your the answers to general mathematical expressions. There's a lot of subtleties to consider here, while it may seem simple it isn't. A general purpose solution to this problem involves multiple complicated steps that humans do unconsciously:

    1. Turn a list of characters into a list of words (Scan)
    2. Turn a list of words into a tree representing the expression (Parse)
    3. Calculate each branch of the tree recursively until you get the result (Interpret)

    For example:

    1. 1,2, ,+, ,4, ,*, ,2
    2. 12,+,4,*,2
    3. (add 12 (multiply 4 2)) = (add 12 8) = 20

    This area of programming is referred to as expression parsing, and while it's not the hardest thing it's quite theory heavy. I do remember somebody producing an expression parser using the eventsheet system awhile back, it was quite complicated...

    There are 2 "cheats" solutions to this. The first is to have 2 text inputs for values, and a dropdown with a list of operators that a user can select. While it obviously doesn't match up to your examples it is very simple to implement. The second is to just evaluate each line of text as JavaScript, this is also super simple but allows your users to run arbitrary code. You could run a quick check over each letter and only evaluate it if it matches safe characters ( 0-9, +, -, /, * ).

    For an intermediate solution you could create something that does the Scan, Parse and Interpret steps but uses a simpler format such as reverse polish(RP) notation 2 4 * 12 + or S-expressions (add 12 (multiply 2 4)). RP is the easiest as it is linear, not recursive, but is confusing for most people to write. S-expressions are easier to write but again aren't what people are used to writing. Both bypass the issue of operator precedence ( is 12 + 4 * 2 the same as (12 + 4) * 2 or 12 + (4 * 2) ) which is one of the more complicated issues around parsing.

    For an advanced solution I would recommend reading up on Recursive Descent parsers or Pratt parsers.

  • I guess if you really wanted to you could stash a reference to the original console object and replace it with an object which has the same methods, but are no-ops. Then in your code use the original console object.

    You would likely need to add global error and unhandled promise rejection event listeners so that any errors wouldn't be printed to the log.

    This is likely to be pretty brittle. Things like failed network requests get printed to the log even if they are caught, and it won't intercept any logs from web workers. But it might work for your project. If not you might want to consider making a fake console window for your game.

  • Wave audio files are basically a wrapper with some header information around the plain PCM audio. All audio formats have to be converted back to PCM to be played by a computer anyway, that's one of the reasons that pretty much everything supports wave files.

    In terms of getting PCM audio you can use the web audio API. It provides a method that takes any audio file supported by the platform and converts it into an "AudioBuffer" object which is a loose wrapper around the PCM data. Once you have that you basically need to find a way to pack it into a wave file.

    I had a quick look and there's a rough method for creating a wave audio file here. It could do with tidying up, and it needs some minor adaptation but it's quite doable.

    Most of this requires some sort of JS knowledge unfortunately...

  • z-worker is part of the archiving process, so it would be affecting any form of saving not just cloud save. I don't think we've heard any other mentions of this. Best guess is some networking issue?

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs