08-30-2024, 05:53 PM
So part of A.I. is getting a computer to exhibit critical thinking.
I guess we could start off with some rudimentary approaches, for example:
The computer memorizes and evaluates values, and decides to only catch red apples, fairly soon.
Refinements would include ways to deduce this faster, and to widen the sampling if we gave it feedback using greater variance with its results vs the best possible outcome. I mean real A.I. means the computer would keep refining its calculation method until it reached the most efficient method.
Anyway, just having some fun and wondering if anyone else has made anything along A.I. lines they would like to share, or just discuss in this thread.
I'll be back a bit later today to catch up!
Pete
I guess we could start off with some rudimentary approaches, for example:
Code: (Select All)
Randomize Timer
Palette 7, 63
Color 0, 7: Cls
View Print 1 To 23
Dim As Integer red, green, blue, mred, mgreen, mblue, i, cnt, pass(3)
score = 100
Do
cnt = cnt + 1
red = Rnd * 10 - 4
green = Rnd * 10 - 6
blue = Rnd * 10 - 8
i = Int(Rnd * 3) + 1
Print i;
If pass(i) Then action$ = "Pass" Else action$ = "Catch"
Select Case i
Case 1
Color 4, 7: Print "RED "; red; action$
If action$ = "Catch" Then
score = score + red
mred = mred + red
End If
Case 2
Color 2, 7: Print "GREEN "; green; action$
If action$ = "Catch" Then
score = score + green
mgreen = mgreen + green
End If
Case 3
Color 1, 7: Print "BLUE "; blue; action$
If action$ = "Catch" Then
score = score + blue
mblue = mblue + blue
End If
End Select
Color 0, 7
x = CsrLin
Locate 25, 1: Print "Score = "; LTrim$(Str$(score)); " ";
Locate x, 1
If cnt = 10 Then
If mred < mblue And mred < mgreen Then If pass(2) + pass(3) <> 5 Then pass(1) = 1 ' Don't catch red apples.
ElseIf mgreen < mred And mgreen < mblue Then If pass(1) + pass(3) <> 4 Then pass(2) = 2 ' Don't catch green apples.
ElseIf mblue < mred And mblue < mgreen Then If pass(1) + pass(2) <> 3 Then pass(3) = 3 ' Don't catch blue apples.
cnt = 0
End If
Sleep
If InKey$ = Chr$(13) Then Run
Loop
The computer memorizes and evaluates values, and decides to only catch red apples, fairly soon.
Refinements would include ways to deduce this faster, and to widen the sampling if we gave it feedback using greater variance with its results vs the best possible outcome. I mean real A.I. means the computer would keep refining its calculation method until it reached the most efficient method.
Anyway, just having some fun and wondering if anyone else has made anything along A.I. lines they would like to share, or just discuss in this thread.
I'll be back a bit later today to catch up!
Pete
Shoot first and shoot people who ask questions, later.