Most machines have predictable output. The mill, the clock, the engine, each has a cycle that is unvarying and expected. Even in prehistoric times, however, people built a different kind of machine, devices that were generative: they produced original results not explicitly intended by their creators. One very early example is the family of divination systems used throughout Africa called geomantic systems. These are still in wide use today, and we know from inclusions in burials that they were already old when the Egyptian dynasties were just beginning. They were largely virtual machines, or software: a set of rules that if followed exactly would provide a result, rather than a physical apparatus that applied those rules.
The “hardware” of these systems is extremely simple: a grid of squares drawn in the dirt with a stick, or an array of pits dug into wood or stone, along with a handful of different colored markers. There are many variations throughout Africa and the Middle East, with layers of complexity built up over time. A typical example of their use would go something like this: the fortune-teller takes a handful of seeds and drops a few into each pit. The seeds are removed from each pit in pairs, leaving either one or two seeds in each pit. This binary code is recognized by name and used to pick out an answer to the query from a memorized structure. The code is sometimes related to the appearance of the symbol string. For example, in one system the pattern 2-1-1-1, bearing a resemblance to a flag on a flag-pole, carries a meaning of exultation (in the table below this pattern is labeled Caput Draconis, perhaps because of its resemblance to the head of the constellation Draco).
These simple patterns composed of four binary symbols are generated in groups, and the elements are recombined to derive new patterns, such as taking the first symbol from the first pattern, the second symbol from the second pattern and so forth to form a derived daughter pattern from the original mother patterns. The daughter patterns then could be recombined using addition (mod 2) to form yet another new pattern, whose meaning modifies that of the original pattern. The details are strictly passed down within a tradition, but variants exist across Africa and the Middle East. The patterns are associated not only with an interpreted meaning, but with the planets, the elements, the gods, the points of the compass, the signs of the zodiac, and so forth.
Where did such a system come from? Anthropologists can only speculate, but the same block of pits and seeds is also used for other purposes in these societies. For an illiterate population, it is a way of performing addition, subtraction, multiplication and division in a concrete way that all parties can verify, by literally reenacting the event being calculated with a single seed standing for a single item. It performed functions of rewritable memory that had previously only been possible within the brain. Before the invention of writing or numbers, it was a system of symbols that represented other goods, that remapped time and space into an abstract world, with its own discrete units of space and time.
modified from Games of the Gods by Nigel Pennick, p. 55-63
I am the revealer of secrets; in me are marvels of wisdom and strange and hidden things. But I have spread out the surface of my face out of humility, and have prepared it as a substitute for earth.… From my intricacies there comes about perception superior to books concerned with the study of the art.
From this inscription we can see that the device was personified, yet was presented without pretence as a machine. Whether using a mechanical device or simply following a set of rules, the petitioners believed that a mechanical process could behave in an intelligent way. This was their central discovery: that ideas could be held in objects, and by manipulating those ideas mechanically, one could learn something new.
The connections with modern computers are more than coincidences. The same features that made a pitted board useful for tracking heads of cattle also made it ideal for playing a game and for divination: external symbols that both players could refer to. Regarding this relationship between games and divination devices, anthropologist Wim van Binsbergen writes:Another use of the same type of pits and seeds was the board game Mancala. In Mancala, the pits are said to represent fields and the markers represent seeds being sown. In this use as well, we see the board acting as a model of another activity, a simplified model with continuous space and time replaced with discrete divisions. The seeds and pits resemble the paper tape and marks along it that Turing imagined in his seminal paper on computation.
Both material divination systems and board-games are formal systems, which can be fairly abstractly defined in terms of constituent elements and rules relatively impervious to individual alteration. Both consist in a drastic modeling of reality, to the effect that the world of everyday experience is very highly condensed, in space and in time, in the game and the divination rite. The unit of both types of events is the session, rarely extending beyond a few hours, and tied not only to the restricted space where the apparatus (e.g. a game-board, a divining board or set of tablets) is used but, more importantly, to the narrowly defined spatial configuration of the apparatus itself. Yet both the board-game and the divination rite may refer to real-life situations the size of a battle field, a country, a kingdom or the world, and extending over much greater expanses of time (a day, a week, a year, a reign, a generation, a century, or much more) than the duration of the session. In ways which create ample room for the display of cosmological and mythical elements, divination and board-games constitute a manageable miniature version of the world, where space is transformed space: bounded, restricted, parcelled up, thoroughly regulated; and where time is no longer the computer scientist’s “real time” — as is clearest when divination makes pronouncements about the past and the future. Utterly magical, board-games and divination systems are space-shrinking time-machines. 
Considered as a way to predict the future, any existing form of divination will be little better than chance. Its interest for our purposes lies not in its accuracy, but in the way it brought people to confront the issues of artificial generation of meaning millennia before the invention of computers. As a way of holding information and allowing it to be manipulated, these techniques provided a way of working out possibilities in a safe space.
 The first abaci were drawn in the sand and used pebbles as counters, and later used pits and grooves carved in wood. The word abacus comes from the Hebrew abaq, meaning “dust.” The pebbles (calculi) used in the Roman abacus are the origin of words such as calculate.
 Wim van Binsbergen, Board-games and divination in global cultural history (web page), 1997