The “Preposition Game” for improving your English

My English was never great, but as I’m going to apply to the IELTS I need to polish all rough edges and, of course, learn more.

One thing that bothers me is the use of prepositions, I never get that right: “on”, “in”, and “at” are a big source of confusion, as “to”, “for”, and “by”. So, I wanted to trick my future self into learning those as I know he’s lazy. The solution? To create a small game I can play anytime because the boring task becomes fun.

I created a bookmarklet (yeah, yeah, bookmarklets are dead, I know!) that replaces all the prepositions in any web page to select boxes with options, as you choose the option, it becomes green or red to indicate if you got that right or not:

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Here is the code for the bookmarklet. It’s not a good code as it leaks its variables in the page, but it does the job:

If you want to try, right-click in your bookmarks bar, choose “add page” and paste the following gibberish on the “URL” field:

javascript:var%20%24jscomp%3D%24jscomp%7C%7C%7B%7D%3B%24jscomp.scope%3D%7B%7D%3B%24jscomp.arrayIteratorImpl%3Dfunction(a)%7Bvar%20b%3D0%3Breturn%20function()%7Breturn%20b%3Ca.length%3F%7Bdone%3A!1%2Cvalue%3Aa%5Bb%2B%2B%5D%7D%3A%7Bdone%3A!0%7D%7D%7D%3B%24jscomp.arrayIterator%3Dfunction(a)%7Breturn%7Bnext%3A%24jscomp.arrayIteratorImpl(a)%7D%7D%3B%24jscomp.makeIterator%3Dfunction(a)%7Bvar%20b%3D%22undefined%22!%3Dtypeof%20Symbol%26%26Symbol.iterator%26%26a%5BSymbol.iterator%5D%3Breturn%20b%3Fb.call(a)%3A%24jscomp.arrayIterator(a)%7D%3Bfunction%20printSolution(a)%7Bvar%20b%3Da.getAttribute(%22data-answer%22)%3BArray.from(a.selectedOptions).map(function(a)%7Breturn%20a.text%7D).includes(b)%3Fa.style.border%3D%222px%20solid%20green%22%3Aa.style.border%3D%222px%20solid%20red%22%7Dfor(var%20prepositions%3D%5B%22%22%2C%22on%22%2C%22at%22%2C%22in%22%5D%2CprepOptions%3Dprepositions.map(function(a)%7Breturn%22%3Coption%3E%22%2Ba%2B%22%3C%2Foption%3E%22%7D)%2CprepSelect%3D'%3Cselect%20data-answer%3D%22%241%22%20onchange%3D%22printSolution(this)%22%20style%3D%22border%3A%202px%20solid%20black%22%3E'%2BprepOptions%2B%22%3C%2Fselect%3E%22%2Cparagraphs%3Ddocument.getElementsByTagName(%22p%22)%2C%24jscomp%24iter%240%3D%24jscomp.makeIterator(paragraphs)%2C%24jscomp%24key%24p%3D%24jscomp%24iter%240.next()%3B!%24jscomp%24key%24p.done%3B%24jscomp%24key%24p%3D%24jscomp%24iter%240.next())%7Bvar%20p%3D%24jscomp%24key%24p.value%3Bp.innerHTML%3Dp.innerHTML.replace(%2F%5Cb(on%7Cin%7Cat)%5Cb%2Fg%2CprepSelect)%7D%3Bvoid+0

Then go to any page (Wikipedia is the best!) and have fun!

Written by

Just a common guy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store