Hi,
Get both files while you still can !!!
Then play it and FUCK IT and modify it and try creating your own tape
editor.
http://members.home.nl/hbthouppermans/Combat/
Maybe I can create a tape editor later on so you could make tape/ai
program.
Maybe a human can make better program then randomized ai program.
Though the ai can learn though.. kinda... load/save implemented in game.
Your own tape will "learn" as well LOL.
(multiplayer not working at the moment, maybe in the future ;) :) )
Here is module needed to work with wolfram stuff:
// *** Begin of wolfram module ***
unit Unit_TwolframMachine_version_002;
{
Skybuck's implementation of Wolfram's (Turing-like) Machine
Version 0.02 created on 25 october 2007 by Skybuck Flying ;)
<comments cut>
Based on story at:
http://www.wolframscience.com/prizes/tm23/turingmachine.html
}
{
version 0.02 Updated on 28 october 2007 by Skybuck Flying
method: SaveTape added
method: LoadTape added
}
interface
type
TwolframPosition = 1..2*1000*1000; // 1 to 10 million positions on tape
available for now ;)
// TwolframPosition = 1..100; // for now let's just use 100 for easy
displaying.
TwolframState = ( ws_prev, ws_next ); // up/down in picture ;)
TwolframColor = ( wc_orange, wc_yellow, wc_white );
TwolframMove = ( wm_left, wm_right );
TwolframOutput = record
OutputState : TwolframState;
OutputColor : TwolframColor;
OutputMove : TwolframMove;
end;
TwolframTransition = array[TwolframState] of array[TwolframColor] of
TwolframOutput;
TwolframTape = packed array[TWolframPosition] of TwolframColor;
TwolframMachine = record
mInputState : TwolframState; // remembers last input state
mInputColor : TwolframColor; // remembers last input color
mInputPosition : TwolframPosition; // remembers last input position
mOutputState : TwolframState; // remembers last output state
mOutputColor : TwolframColor; // remembers last output color
mOutputPosition : TwolframPosition; // remembers last output position
mOutputMove : TwolframMove;
mState : TwolframState; // current state
mHead : TwolframPosition; // current head position
mTape : TwolframTape;
mProcessor : TwolframTransition;
procedure SetupProcessor;
procedure Initialize;
procedure Execute;
procedure SaveTape( ParaFileName : string );
procedure LoadTape( ParaFileName : string );
end;
implementation
uses
Classes, SysUtils;
procedure TwolframMachine.SetupProcessor;
begin
// state up
mProcessor[ws_prev][wc_orange].OutputState := ws_prev;
mProcessor[ws_prev][wc_orange].OutputColor := wc_yellow;
mProcessor[ws_prev][wc_orange].OutputMove := wm_left;
mProcessor[ws_prev][wc_yellow].OutputState := ws_prev;
mProcessor[ws_prev][wc_yellow].OutputColor := wc_orange;
mProcessor[ws_prev][wc_yellow].OutputMove := wm_left;
mProcessor[ws_prev][wc_white].OutputState := ws_next;
mProcessor[ws_prev][wc_white].OutputColor := wc_yellow;
mProcessor[ws_prev][wc_white].OutputMove := wm_right;
// state down
mProcessor[ws_next][wc_orange].OutputState := ws_prev;
mProcessor[ws_next][wc_orange].OutputColor := wc_white;
mProcessor[ws_next][wc_orange].OutputMove := wm_right;
mProcessor[ws_next][wc_yellow].OutputState := ws_next;
mProcessor[ws_next][wc_yellow].OutputColor := wc_orange;
mProcessor[ws_next][wc_yellow].OutputMove := wm_right;
mProcessor[ws_next][wc_white].OutputState := ws_prev;
mProcessor[ws_next][wc_white].OutputColor := wc_orange;
mProcessor[ws_next][wc_white].OutputMove := wm_left;
end;
procedure TwolframMachine.Initialize;
var
vPosition : TwolframPosition;
begin
SetupProcessor;
// position head at center of tape.
mHead := High(TwolframPosition) div 2;
// start state is prev
mState := ws_prev;
// clear tape
for vPosition := Low(TwolframPosition) to High(TwolframPosition) do
begin
mTape[vPosition] := wc_white;
end;
end;
procedure TwolframMachine.Execute;
begin
mInputPosition := mHead;
mInputColor := mTape[mHead];
mInputState := mState;
mOutputState := mProcessor[mState][mInputColor].OutputState;
mOutputColor := mProcessor[mState][mInputColor].OutputColor;
mOutputPosition := mHead;
mOutputMove := mProcessor[mState][mInputColor].OutputMove;
// update tape contents
mTape[mHead] := mOutputColor;
// update head position
// wrap arounds possible.
case mOutputMove of
wm_left :
begin
if mHead = Low(TwolframPosition) then
begin
mHead := High(TwolframPosition);
end else
begin
mHead := Pred(mHead);
end;
end;
wm_right :
begin
if mHead = High(TwolframPosition) then
begin
mHead := Low(TwolframPosition);
end else
begin
mHead := Succ(mHead);
end;
end;
end;
// update state
mState := mOutputState;
end;
procedure TwolframMachine.SaveTape( ParaFileName : string );
var
vFileStream : TfileStream;
vTapePosition : TwolframPosition;
vBytesToWrite : integer;
vBytesWritten : integer;
begin
vFileStream := TfileStream.Create( ParaFileName, fmCreate or
fmShareDenyNone );
vTapePosition := Low(TwolframPosition);
while vTapePosition < High(TwolframPosition) do
begin
vBytesToWrite := High(TwolframPosition) - vTapePosition;
if vBytesToWrite > 4*1024 then vBytesToWrite := 4*1024;
vBytesWritten := vFileStream.Write( mTape[vTapePosition], vBytesToWrite
);
vTapePosition := vTapePosition + vBytesWritten;
end;
vFileStream.Free;
end;
procedure TwolframMachine.LoadTape( ParaFileName : string );
var
vFileStream : TfileStream;
vTapePosition : TwolframPosition;
vBytesToRead : integer;
vBytesRead : integer;
begin
vFileStream := TfileStream.Create( ParaFileName, fmOpenRead or
fmShareDenyNone );
vTapePosition := Low(TwolframPosition);
while vTapePosition < High(TwolframPosition) do
begin
vBytesToRead := High(TwolframPosition) - vTapePosition;
if vBytesToRead > 4*1024 then vBytesToRead := 4*1024;
vBytesRead := vFileStream.Read( mTape[vTapePosition], vBytesToRead );
vTapePosition := vTapePosition + vBytesRead;
end;
vFileStream.Free;
end;
end.
// *** End of wolfram module ***
Re-posted in case other post with combat ai was too big... just this
module
need to make load/save tape and thereby make tape editor.
Bye,
Skybuck.


|