Code Monkey home page Code Monkey logo

swf75's Introduction

Besieging Everest

Mount Everest

A coding competition in the q programming language for the benefit of Community Action Nepal.

Everest The Hard Way: watch the 45th anniversary screening and Q&A on 2020.09.24.

Background

The 1975 British Everest Expedition set out to climb the biggest mountain in the world by its hardest route, the South West Face. It was among the last of the ‘siege’ expeditions, with 18 climbers, 60 porters, and 24 tons of equipment. It was led by Chris Bonington, a former army officer, who used a computer program to help plan the formidable logistics.

His logistics worked. The expedition put (at that time) more climbers on the summit, by the hardest route, and in the shortest time.

The computer program was written in APL, the ancestor language of q. It was my first solo software project. Chris would have liked a program that planned the logistics, but writing that was beyond me. Instead I wrote a program that represented the logistics state. Chris did the hard work of generating movement orders, and we used the program together through the winter of 1974-5 to explore the problem space.

In outline the problem is simple. The final assault on the summit would be made by two climbers from the highest of seven camps: Base Camp and Camps 1-6. (Like coders, mountaineers start counting at zero.) Establishing two climbers at Camp 6 meant building a supply line that would pass upwards food, fuel, gear and oxygen cylinders while also consuming them. The supply chain had to be able to sit out days of bad weather, but the whole thing had to be done in a few weeks between the monsoon and the winter storms.

A partial solution

In my innocence I had originally imagined that the computer would be able to tell me how to plan the expedition, an illusion which I suspect is shared by most laymen. Whilst planning our 1972 expedition, Ian McNaught Davis, a climbing friend of mine and managing director of Comshare, had suggested that we might like to use one of his computers to help in planning. Because the expedition had been organised in such a rush, we had been unable to make full use of this facility; it had, however, shown me its value as a means, not so much of finding the perfect logistic answer, but of checking out one’s own planning thinking.

In the spring of 1975 Ian McNaught Davis once again offered his help making available one of his programmers, Stephen Taylor, and through the spring and early summer we played out a series of computer games, simulating the movement of men and supplies up the mountain. We never actually reached the top, since we always seemed to get stuck in a logistic bottleneck round about the time that Camp 4 was established, the reason being that I was moving my men and supplies by intuition rather than by logic based on a clearcut formula.

Everest The Hard Way, p169

That original program was about 150 lines of Sigma APL code, mercifully long vanished. But in later years, as I gained experience as a developer, I ocasionally wondered what it would take to write the program that Chris wanted. And I kept my copy of Everest The Hard Way, the book Chris wrote about the expedition, with its appendices full of plans, charts and tables.

Everest The Hard Way
Everest The Hard Way

route to the summit
Route to the summit

45 years on

This repo contains the first steps towards a full solution, written in the q programming language, a modern programming language derived from APL.

Tables in q represent the expedition state handily, leaving one free to concentrate on generating movement orders. The script swf.q is already considerably more ambitious than its 1974 ancestor, and manages to stumble through the first few days of expedition time.

The script represents the lead climbing party making a route to the next camp. The function day advances the clock one day and returns the new state.

❯ q swf.q
KDB+ 4.0 2020.08.03 Copyright (C) 1993-2020 Kx Systems
m64/ 12()core 65536MB sjt mackenzie.local 127.0.0.1 EXPIRE 2021.05.27 stephen@kx.com #59875

"Logistics, British Everest Expedition, 1975"
q)day S
climbers haps porters sleep tent food gear o2
----------------------------------------------
18       26   34      50    3098 3734 915  888
0        0    0       0     0    0    153  0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0

Above, on the first day, climbers made 1/3 of the route from Base Camp to Camp 1.

The next development step is movement orders to bring climbers and porters up behind them.

An implicit challenge is to retain the array-programming style, avoiding loops and other control structures.

The Scan and Over iterators suffice to cycle through the days of expedition time.

q)5 day/S
climbers haps porters sleep tent food gear o2
----------------------------------------------
14       26   34      50    346  416  68   100
4        0    0       20    2752 3258 954  788
0        0    0       0     0    0    46   0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0
0        0    0       0     0    0    0    0

Community Action Nepal

Please consider making a donation to Community Action Nepal

Contact

Stephen Taylor [email protected]

swf75's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

gavindonnelly19

swf75's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.