Good Morning All,


Already 5th week, term seems to be flying by!


This Wednesday we will be watching a computer themed film at 7pm. There will, of course, be drinks and pizza. The film is to be decided by vote (which can be as undemocratic as you can make it) – more details follow (PLEASE NOTE the change of venue compared to our printed termcard).


There are also some details about the upcoming committee elections below, please read if you are considering standing.


Finally, since no one solved last week’s challenge (admittedly it is rather lengthy to read, but quite easy to solve), this week’s one is the same one, but with double the prize. There is also a hint, which may save you some time.


Have a good one,


Ben and Alex

CompSoc Co-Presidents




                      The Oxford Computer Society




CompSoc DVD night

Wednesday 15/02, 7pm, St Catz Bernard Sunley Room A


Please note that on our printed termcard the venue is incorrect.


CompSoc DVD night (film TBD). There will be pizza, popcorn and soft drinks! The perfect solution to those mythical 5th week blues. I’m pretty sure there is a whiteboard in that room too, so lively computer science discussion will undoubtedly follow.


To help us decide which film to watch please vote at (no log in required, just unique IP). If none of the films in the list take your fancy, you can write in a preferred film. seems to capture the theme we are going for pretty well. You can’t cancel your vote, so chose wisely.


If you are unable to vote because of college NAT or some other witchcraft, and are unable to vote by other means feel free to send an email with your choice to


Here is a handy map for finding Catz:

And here is another one for finding Bernard Sunley Room A: (room A is on the first floor)


If you get truly lost in Catz, you can call Ben on 0754 999 3401.


FB Event:




Upcoming CompSoc AGM:


You may know that in Week 6 CompSoc will be holding its Annual General Meeting during which the committee for 2012/2013 will be elected. If you think you might be interested in a role on the committee then please feel free to get in touch with us over and we'd be happy to answer any questions that you might have – alternatively speak to us in person of course!


Along with the positions required by the university (President, Secretary and Treasurer) a number of other roles could be suitably created, such as Vice President, Social Secretary, Sponsorship Secretary, Publications Officer, etc. (basically whatever title + support that you think could be provided to the society). Personally, I (Ben) believe that a larger committee than the required roles is highly preferable – there is an upper limit of 10 members to the committee. Constitutionally, we have the that the required positions are:


The President, to preside over meetings, to authorise all expenditure and ultimately be responsible for the running of the Society.

The Secretary, to take minutes at meetings, deal with Society correspondence and stand in for the President when necessary.

The Treasurer, to maintain the accounts of the Society, report to the members thereon, and to stand in for the Secretary when necessary.


The elections themselves will proceed as follows. Initially nominations for President will be asked for, candidate(s) will then give a few words in proposition, questions may be asked to the candidate(s), and then a secret ballot (everyone at the meeting (who is a member) writes down their vote on paper) will be held to determine the winner by simple majority (not counting abstentions). The same will then follow for Secretary and Treasurer. Following this any other positions can be nominated and voted on.


To be nominated you must be proposed by another member, and then seconded by another different member – you must also be a member. You may stand for as many roles as you like, although once you have been appointed to one you cannot stand for another. You may propose or second as many other members as you like (but only 1 per position). For each position you may vote to abstain from voting.


If you are considering standing and need a proposer/seconder feel free to get in touch with as we would be happy to support any candidates looking to stand.




Technology Competition:

Challenge 5:


A discrete elevator simulation.


This challenge is using a given list of discrete elevator request events (found at determine the number of elevators required to service the requests, and their final configuration once the requests have been serviced. The number of elevators required is the minimum needed to ensure all requests are serviced within 21 time blocks (ie completed in 21 or fewer time blocks after creation).


In the file of event requests, an event is either “SKIP”, or a list of requests in the form “x to y;”. “SKIP” is the event where no request was made. “x to y;” is the request go from floor x to floor y. Each line corresponds to the a time block, ie line 0 = time 0, line 1 = time 1 etc. In a single time block the requests for that block are made, then the elevators move in the direction they are travelling in, then the elevators service any requests at the floor they are now at. If an elevator is empty it can enter travel mode, where it will travel towards a selected request with the intention of servicing specifically that request (it can service others as long as they do not want to go past the selected request), as soon as it has picked up the specific request it travels in the direction needed for that request and resumes normal mode.


An elevator can only move up 1 floor, down 1 floor or remain at the same floor during each time block.


There is a building containing elevators which is 10 stories high, with each floor numbered 0 through to 9 (ie. 0 is the ground floor). Users request the elevator by pushing a button on the floor they are currently at, indicating the floor they are going to.


An elevator’s initial configuration is that it is idling at level 0. Individual elevators follow the following protocol:


Elevators can be in 2 modes: Normal mode and Travel mode

Normal mode:

1 currentFloor = currentFloor + direction //as long as this won’t place the elevator out of the building

2 let people out of the elevator if they are in it and this is their floor

3 if no one is in the elevator, then direction = 0 //ie we are idling

4 if anyone is waiting at currentFloor and would like to travel in the same direction as the elevator (or the elevator is idling) then they get on and we go to the floor they requested, if we were idling then we go in the direction for that floor. We always let the people who have been waiting the longest on first.


Travel mode:

1 currentFloor = currentFloor + direction //as long as this won’t place the elevator out of the building

2 let people out of the elevator if they are in it and this is their floor

3 if anyone is waiting at currentFloor and would like to travel between targetFloor and currentFloor then they get on

4 if currentFloor = targetFloor then let anyone on who would like to go in targetDestination direction and set direction to be towards targetDestination

5 switch to Normal mode


An elevator will switch into Travel mode if at the end of part 4 of normal mode it does not contain any passengers. When it switches into travel mode, it will take a request (x to y) which isn’t being acted upon by another elevator and travel to targetFloor (x), doing as much transporting as it can on the way, then will travel towards targetDestination (y). When it is travelling towards targetDestination it has switched back into Normal mode.


If there are [0..N] elevators the system acts in the following manner:

1 todo = <read in request events happening on this time block (if there are any)>

2 for i = 0 to N do

3    execute elevator i’s protocol once, removing any request events from todo which it can immediately handle

4 for i = 0 to N do

5    if elevator i is in Normal mode and empty, and todo is not empty then

6          take the request which has been waiting longest (x to y) from todo, and switch elevator i into Travel mode with targetFloor = x and targetDestination = y

7 advance the time by 1 and go back to step 1


One request is determined to be waiting longer than another if it was generated before the other. If they were generated at the same time, then the request before the other in the list defining them in the requests.txt file is the one that has been waiting longer.


Answers can be submitted to<num of elevators><final floor of elevator 0><final floor of elevator 1><etc..> (obviously without the brackets, ie just a string of numbers). Whilst the solution to this challenge may seem to favour using methods taught in 2nd year CompSci, it can clearly be solved without using any of that fanciness.


An example runthrough and solution can be found at


As a clue to help you solve it, 6 elevators are required to service all of the requests in time.


Anyone (with a email address) can sign up to the competition through the website, but only members can receive prizes. isn't connected to the compsoc network, and so you will need to make a new account to participate.


For more details about the competition see or contact if you have questions about this round.




Technology Competition:

Week 4 result:


No one solved the challenge!




CompSoc Jobs Mailing list


The society receives a number of advertisements each week from companies and individuals interested in employing our members. The jobs range from graduate positions, to a bit of help with another societies website.


If you would like to receive these emails just email with 'subscribe' in the subject line.