여기 작은 기본의 코드입니다 (작은 Basic에서) :"Get Pixel"루프는 발견 된 픽셀을 놓치게됩니다.
GraphicsWindow.CanResize = 0
GraphicsWindow.Width = 201
GraphicsWindow.Height = 300
X = 0
circumstance = 0
'Initialization
GraphicsWindow.SetPixel(100,0,"Black")
code = "01111111"
'Start
For i=1 To GraphicsWindow.Height
For X=0 To GraphicsWindow.Width
Program.Delay(1)
If X>0 Then
If GraphicsWindow.GetPixel(X-1,i-1) = "Black" Then
circumstance = circumstance + 1
EndIf
EndIf
If GraphicsWindow.GetPixel(X,i-1) = "Black" Then
circumstance = circumstance + 10
EndIf
If X<GraphicsWindow.Width Then
If GraphicsWindow.GetPixel(X+1,i-1) = "Black" Then
circumstance = circumstance + 100
EndIf
EndIf
TextWindow.WriteLine(circumstance)
EndFor
EndFor
그것이 무엇을하는 것은 픽셀로 그래픽 창 픽셀 통해 보이는 것입니다. 변수 "상황"이 발견 된 것입니다. 대상 픽셀의 왼쪽 상단에 검정색 픽셀이있는 경우 첫 번째 숫자는 1입니다. 대상 픽셀의 위쪽에 검정색 픽셀이있는 경우 두 번째 숫자는 1이됩니다. 검정 픽셀을 대상 픽셀의 오른쪽 상단에 놓으면 세 번째 숫자는 1이됩니다. 상황에 관계없이 항상 000을 출력합니다.