tl;dr? Just want instructions on how to solve Jigidi puzzles really fast with the help of your browser’s dev tools? Skip to that bit.
This approach doesn’t work any more. Want to see one that still does (but isn’t quite so automated)? Here you go!
I don’t enjoy jigsaw puzzles
I enjoy geocaching. I don’t enjoy jigsaw puzzles. So mystery caches that require you to solve an online jigsaw puzzle in order to get the coordinates really
don’t do it for me. When I’m geocaching I want to be outdoors exploring, not sitting at my computer gradually dragging pixels around!
Many of these mystery caches use Jigidi to host these jigsaw puzzles. An earlier version of Jigidi was auto-solvable with a userscript, but the service has continued to be developed and evolve and the current version works quite hard to
make it hard for simple scripts to solve. For example, it uses a WebSocket connection to telegraph back to the server how pieces are moved around and connected to one another and the
server only releases the secret “you’ve solved it” message after it detects that the pieces have been arranged in the appropriate relative configuration.
If there’s one thing I enjoy more than jigsaw puzzles – and as previously established there are about a billion things I enjoy more than jigsaw puzzles – it’s reverse-engineering a
computer system to exploit its weaknesses. So I took a dive into Jigidi’s client-side source code. Here’s what it does:
Get from the server the completed image and the dimensions (number of pieces).
Cut the image up into the appropriate number of pieces.
Shuffle the pieces.
Establish a WebSocket connection to keep the server up-to-date with the relative position of the pieces.
Start the game: the player can drag-and-drop pieces and if two adjacent pieces can be connected they lock together. Both pieces have to be mostly-visible (not buried under other
pieces), presumably to prevent players from just making a stack and then holding a piece against each edge of it to “fish” for its adjacent partners.
I spent some time tracing call stacks to find this line… only to discover that it’s one of only four lines to actually contain the word “shuffle” and I could have just searched for
it…
Looking at that process, there’s an obvious weak point – the shuffling (point 3) happens client-side, and before the WebSocket sync begins. We could override the
shuffling function to lay the pieces out in a grid, but we’d still have to click each of them in turn to trigger the connection. Or we could skip the shuffling entirely and just leave
the pieces in their default positions.
An unshuffled jigsaw appears as a stack, as if each piece from left to right and then top to bottom were placed one at a time into a pile.
And what are the default positions? It’s a stack with the bottom-right jigsaw piece on the top, the piece to the left of it below it, then the piece to the left of that and son on
through the first row… then the rightmost piece from the second-to-bottom row, then the piece to the left of that, and so on.
That’s… a pretty convenient order if you want to solve a jigsaw. All you have to do is drag the top piece to the right to join it to the piece below that. Then move those two to the
right to join to the piece below them. And so on through the bottom row before moving back – like a typewriter’s carriage return – to collect the second-to-bottom row and so on.
How can I do this?
If you’d like to cheat at Jigidi jigsaws, this approach works as of the time of writing. I used Firefox, but the same basic approach should work with virtually any modern desktop web
browser.
Go to a Jigidi jigsaw in your web browser.
Pop up your browser’s developer tools (F12, usually) and switch to the Debugger tab. Open the file game/js/release.js and uncompress it by pressing the
{} button, if necessary.
Find the line where the code considers shuffling; right now for me it’s like 3671 and looks like this:
return this.j ? (V.info('board-data-bytes already exists, no need to send SHUFFLE'), Promise.resolve(this.j)) : new Promise(function (d, e) {
I spent some time tracing call stacks to find this line… only to discover that it’s one of only four lines to actually contain the word “shuffle” and I could have just searched
for it…
Set a breakpoint on that line by clicking its line number.
Restart the puzzle by clicking the restart button to the right of the timer. The puzzle will reload but then stop with a “Paused on breakpoint” message. At this point the
application is considering whether or not to shuffle the pieces, which normally depends on whether you’ve started the puzzle for the first time or you’re continuing a saved puzzle from
where you left off.
In the developer tools, switch to the Console tab.
Type: this.j = true (this ensures that the ternary operation we set the breakpoint on will resolve to the true condition, i.e. not shuffle the pieces).
Press the play button to continue running the code from the breakpoint. You can now close the developer tools if you like.
Solve the puzzle as described/shown above, by moving the top piece on the stack slightly to the right, repeatedly, and then down and left at the end of each full row.
Update 2021-09-22:Abraxas observes that Jigidi have changed
their code, possibly in response to this shortcut. Unfortunately for them, while they continue to perform shuffling on the client-side they’ll always be vulnerable to this kind of
simple exploit. Their new code seems to be named not release.js but given a version number; right now it’s 14.3.1977. You can still expand it in the same way,
and find the shuffling code: right now for me this starts on line 1129:
Put a breakpoint on line 1129. This code gets called twice, so the first time the breakpoint gets hit just hit continue and play on until the second time. The second time it gets hit,
move the breakpoint to line 1130 and press continue. Then use the console to enter the code d = a.G and continue. Only one piece of jigsaw will be shuffled; the rest will
be arranged in a neat stack like before (I’m sure you can work out where the one piece goes when you get to it).
Update 2023-03-09: I’ve not had time nor inclination to re-“break” Jigidi’s shuffler, but on the rare ocassions I’ve
needed to solve a Jigidi, I’ve come up with a technique that replaces a jigsaw’s pieces with ones that each
show the row and column number they belong to, as well as colour-coding the rows and columns and drawing horizontal and vertical bars to help visual alignment. It makes the process
significantly less-painful. It’s still pretty buggy code though and I end up tweaking it each and every time I use it, but it certainly works and makes jigsaws that lack clear visual
markers (e.g. large areas the same colour) a lot easier.
I happened to be passing through with a little time to spare so I thought I’d take another run at this one. Unfortunately my first attempt had seen me make my notes on the back of my hand (and I’ve washed them since then!) so I’d have to
collect the clues again. At least I already had the one from the church (thanks, CO!), so I parked at the Village Hall and went about (re)
collecting the others.
To my surprise, the pub seems have repainted its windows since my last visit: clearly in a specific effort to fool and confuse geocachers! Luckily I knew broadly where I was looking so
I wasn’t caught out.
Soon I was on my way to the cache. The hint was definitely needed as I hadn’t expected a container of this design in a location like this one! SL. TFTC, and special thanks to the attentive CO who provided an
extra hint for people who, like me, got stuck outside the locked church.
I needed to divert from my journey from Summertown to Eynsham anyway to stop at the nearby Sainsburys, so I took the opportunity for a quick stroll down to find this cache. Do you think
the nearby gate is always left locked-open? That seems surprising! A relatively quick find although some stealth skills were needed. SL,
TFTC.
After all the amazing containers and hiding places I’ve seen on this excellent series, this final destination almost felt… mundane, by comparison. Not that that’s a problem, and I was
still happy to reach the end, be treated to a great view of the last of the sun disappearing over the horizon, and find a good sized logbook complete with the notes and praises (for the
series!) of cachers who’d come before me.
An altogether delightful series that I’ve been really glad to have explored. I’m looking forward to coming back and searching for #9 again sometime soon! TFTCaches!
Lots of deer in the fields tonight! The sun was beginning to set as I approached this, my penultimate cache for the day, so my bike lights went on again and now stayed on. I felt sure I
knew what I’d be looking for, but I was nevertheless delighted by the imaginative cache container.
Leaving this GZ, I made a few wrong turns before eventually working out which path I needed to follow to the finale: for some reason, the
correct path doesn’t appear on my (OSM-derived). I’ve kept a tracklog, though, so I’ll try to get the map updated!
As I worked my way to this, the third cache in my tour for today, I realised that my local sparrowhawk – who lives up a tree behind my house in Sutton – seemed to be following me. I’d
seen him atop a couple of telegraph poles earlier on and I’d heard him screech a few times, and when I looked up I saw that he was still above me. Perhaps he’d decided to come on this
expedition too?
One of the things that I love most about this series is the diversity of quirky and unusual cache containers, of which this was no exception. I was also pleased to find a fresh, clean
log sheet, and added my name as the first on the list. TFTC, and FP for the
surprise!
Deer were prancing around the fields as I came through, and I realised that the hiding place for this cache must be near a place I’d thought about once as a possible hiding place
myself, when I first moved to the area and took a walk this way (before I’d looked at the local caches!). While retrieving the cache a dog walker came the other way and, seeing a
cyclist on a not-entirely-cycle-friendly path, probing around looking for something, asked about my activity. He’d never heard of geocaching, but he’d heard of hide-and-seek and he’d
heard of orienteering, and seemed happy enough to accept that it was some combination of these two.
Came out for a cycle tour today to complete the loop: I covered the first half – with the exception of a DNF at #9 – last month, and I was itching to get out and complete the second half. (Having gotten home
after this second expedition I see that #9 has been repaired/improved, so I’ll fly by and give that another go sometime soon!)
I was glad to have brought my bike lights: even though it’s a while until sunset it was helpful to find my way in the wooded area that surrounds this cache. Great hiding place for this
one: the only cache I’ve come across of a remotely similar design was my own GC7R0HB (which sadly got muggled one too many times and had to be archived a few years ago).
“I like travelling by public transport and by bus; I think it’s a great way to see the country,” Mr Kibble explains.
..
Mr Kibble figured the furthest he could get in one day would be Morecambe in Lancashire – some 260 miles from Charing Cross, the geographical centre of London.
…
I’m sure that many of you, like me, really enjoyed The Political Travelling Animal‘s Twitter adventure up the country, last week. If you missed it (and you should really go read it if you did): Jo decided to see how far he could get from London within 24 hours via local bus routes only,
and live-tweeted the entire experience for the world to enjoy too. Perhaps unsurprisingly, I particularly enjoyed that fact that he gave a nod to Preston’s unusual and iconic bus
station.
Reading it, though, I found myself reminded of a time, long ago, that I planned (although never took) a similar journey. In 1999 I moved
away from my family in Preston to Aberystwyth to go to university.
Before he became a bus my father was a bus industry professional and at a rest stop during the journey to Aberystwyth as he dropped me off,
he and I perused the (paper) timetables to explore a hypothesis that the pair of us had come up with.
Our question: Is it possible to travel from Aberystwyth to Preston, in a single day, using local bus routes only?
After much consideration, we determined that yes, it was possible, but better than that: it was possible to do so (at the time) entirely on Arriva buses. This presented an
unexploited opportunity: for the price of an “all day” Arriva ticket (£2.20, IIRC), an enterprising and poor student could, in
a pinch, find their way back from Aberystwyth to Preston over the course of about 16 hours for only a fraction more than the price of a pint of beer.
This was utterly academic: in the years that followed, I would almost invariably leave Aberystwyth by train. Sometimes I’d do this to go
to London: a route for which, I discovered, I could catch the 6am train, hide aboard it as it was vacated at its Birmingham New Street terminus and take a nap, safe in the knowledge
that the same rolling stock would subsequently become a train to London Euston! Other times I’d return to Preston; a journey for which not even floods could stop me.
But regardless, for my first full term at university I kept on the corner of the desk in my study room the sum of £2.20, as an “insurance policy”. No matter what happened in this new
phase of my life, that small pile of coins could, at a stretch, get me back “home”.
By Christmas 1999 I’d re-purposed the coins to do my laundry (the washing machines in the halls’ laundrette took pound coins and the dryers 20p pieces, so this was a far more-valuable
use of spare change in those denominations). By this point I’d settled in and had become confident that Aberystwyth was likely to be my home almost year-around, and indeed I’d go on to
live there another decade before saying goodbye for Oxfordshire.
But we answered the question, at least in theory: a hypothetical but symbolic question about the versatility and utility of an interconnected network of local bus routes. And that’s
just great.
As I mentioned last year, for several years I’ve collected pretty complete historic location data from GPSr devices I carry with me everywhere, which I collate in a personal μlogger server.
Going back further, I’ve got somewhat-spotty data going back a decade, thanks mostly to the fact that I didn’t get around to opting-out of Google’s location tracking until only a few years ago (this data is now
also housed in μlogger). More-recently, I now also get tracklogs from my smartwatch, so I’m managing to collate more personal
location data than ever before.
The blob around my house, plus some of the most common routes I take to e.g. walk or cycle the children to school.
A handful of my favourite local walking and cycling routes, some of which stand out very well: e.g. the “loop” just below the big blob represents a walk around the lake at Dix Pit;
the blob on its right is the Devils Quoits, a stone circle and henge that I thought were sufficiently interesting that
I made a virtual geocache out of them.
The most common highways I spend time on: two roads into Witney, the road into and around Eynsham, and routes to places in Woodstock and North Oxford where the kids have often had
classes/activities.
I’ve unsurprisingly spent very little time in Oxford City Centre, but when I have it’s most often been at the Westgate Shopping Centre,
on the roof of which is one of the kids’ favourite restaurants (and which we’ve been able to go to again as Covid restrictions have lifted, not least thanks to their outdoor seating!).
One to eight years ago
Let’s go back to the 7 years prior, when I lived in Kidlington. This paints a different picture:
For the seven years I lived in Kidlington I moved around a lot more than I have since: each hotspot tells a story, and some tell a few.
This heatmap highlights some of the ways in which my life was quite different. For example:
Most of my time was spent in my village, but it was a lot larger than the hamlet I live in now and this shows in the size of my local “blob”. It’s also possible to pick out common
destinations like the kids’ nursery and (later) school, the parks, and the routes to e.g. ballet classes, music classes, and other kid-focussed hotspots.
I worked at the Bodleian from early 2011 until late in 2019, and so I spent a lot of time in
Oxford City Centre and cycling up and down the roads connecting my home to my workplace: Banbury Road glows the brightest, but I spent some time on Woodstock Road too.
For some of this period I still volunteered with Samaritans in Oxford, and their branch – among other volunteering hotspots
– show up among my movements. Even without zooming in it’s also possible to make out individual venues I visited: pubs, a cinema, woodland and riverside walks, swimming pools etc.
Less-happily, it’s also obvious from the map that I spent a significant amount of time at the John Radcliffe Hospital, an unpleasant reminder of some challenging times from that
chapter of our lives.
The data’s visibly “spottier” here, mostly because I built the heatmap only out of the spatial data over the time period, and not over the full tracklogs (i.e. the map it doesn’t
concern itself with the movement between two sampled points, even where that movement is very-guessable), and some of the data comes from less-frequently-sampled sources like Google.
Eight to ten years ago
Let’s go back further:
Back when I lived in Kennington I moved around a lot less than I would come to later on (although again, the spottiness of the data makes that look more-significant than it is).
Before 2011, and before we bought our first house, I spent a couple of years living in Kennington, to the South of Oxford. Looking at
this heatmap, you’ll see:
I travelled a lot less. At the time, I didn’t have easy access to a car and – not having started my counselling qualification yet – I
didn’t even rent one to drive around very often. You can see my commute up the cyclepath through Hinksey into the City Centre, and you can even make out the outline of Oxford’s Covered
Market (where I’d often take my lunch) and a building in Osney Mead where I’d often deliver training courses.
Sometimes I’d commute along Abingdon Road, for a change; it’s a thinner line.
My volunteering at Samaritans stands out more-clearly, as do specific venues inside Oxford: bars, theatres, and cinemas – it’s the kind of heatmap that screams “this person doesn’t
have kids; they can do whatever they like!”
Every map tells a story
I really love maps, and I love the fact that these heatmaps are capable of painting a picture of me and what my life was like in each of these three distinct chapters of my life over
the last decade. I also really love that I’m able to collect and use all of the personal data that makes this possible, because it’s also proven useful in answering questions like “How
many times did I visit Preston in 2012?”, “Where was this photo taken?”, or “What was the name of that place we had lunch when we got lost during our holiday in Devon?”.
There’s so much value in personal geodata (that’s why unscrupulous companies will try so hard to steal it from you!), but sometimes all you want to do is use it to draw pretty heatmaps.
And that’s cool, too.
How these maps were generated
I have a μlogger instance with the relevant positional data in. I’ve automated my process, but the essence of it if you’d like to try it yourself is as follows:
First, write some SQL to extract all of the position data you need. I round off the latitude and longitude to 5 decimal places to help “cluster” dots for frequency-summing, and I raise
the frequency to the power of 3 to help make a clear gradient in my heatmap by making hotspots exponentially-brighter the more popular they are:
This data needs converting to JSON. I was using Ruby’s mysql2 gem to
fetch the data, so I only needed a .to_json call to do the conversion – like this:
db =Mysql2::Client.new(host: ENV['DB_HOST'], username: ENV['DB_USERNAME'], password: ENV['DB_PASSWORD'], database: ENV['DB_DATABASE'])
db.query(sql).to_a.to_json
Approximately following this guide and leveraging my Mapbox
subscription for the base map, I then just needed to include leaflet.js, heatmap.js, and leaflet-heatmap.js before writing some JavaScript code
like this:
body.innerHTML ='<div id="map"></div>';
let map = L.map('map').setView([51.76, -1.40], 10);
// add the base layer to the map
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
maxZoom:18,
id:'itsdanq/ckslkmiid8q7j17ocziio7t46', // this is the style I defined for my map, using Mapbox
tileSize:512,
zoomOffset:-1,
accessToken:'...'// put your access token here if you need one!
}).addTo(map);
// fetch the heatmap JSON and render the heatmap
fetch('heat.json').then(r=>r.json()).then(json=>{
let heatmapLayer =new HeatmapOverlay({
"radius":parseFloat(document.querySelector('#radius').value),
"scaleRadius":true,
"useLocalExtrema":true,
});
heatmapLayer.setData({ data: json });
heatmapLayer.addTo(map);
});
Visited to check on this new cache: especially as the container is a new design I wanted to do an early checkin to ensure it’s bedded in nicely. Glad to say all is well! Also dropped
off Paul The Sea Horse, a Travel Bug I found up in Derbyshire who’s still got a
couple of years exploring left in him before he completes his ten year mission! Please help him move along if you can.
Dropped by to check in on this new cache (always worth checking that a new cache is settling in alright!) and to dip a TB. All is well. Also discovered that
through the kissing gate on the opposite side of the road there’s a crop of the plumpest and brightest sloes I’ve seen in years. So if you’re in the vicinity and fancy a lip-curling
snack (or you’ve plans to adulterate some gin!) take a look!