Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SIZE = 20
- TextWindow.Write("Saisie (ex : 3E 7F FC F8 F8 FC 7F 3E) : ")
- drawing = Text.ConvertToUpperCase(TextWindow.Read())
- If Text.GetLength(drawing) <> 23 Then
- drawing = "3E 7F FC F8 F8 FC 7F 3E"
- EndIf
- For i = 1 To 8
- new_drawing[i] = ""
- EndFor
- y = 0
- For i = 1 To Text.GetLength(drawing) Step 1
- chr = Text.GetSubText(drawing, i, 1)
- If chr = " " Then
- y = y + 1
- ElseIf chr = "0" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0000")
- ElseIf chr = "1" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0001")
- ElseIf chr = "2" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0010")
- ElseIf chr = "3" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0011")
- ElseIf chr = "4" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0100")
- ElseIf chr = "5" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0101")
- ElseIf chr = "6" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0110")
- ElseIf chr = "7" Then
- new_drawing[y] = Text.Append(new_drawing[y], "0111")
- ElseIf chr = "8" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1000")
- ElseIf chr = "9" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1001")
- ElseIf chr = "A" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1010")
- ElseIf chr = "B" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1011")
- ElseIf chr = "C" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1100")
- ElseIf chr = "D" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1101")
- ElseIf chr = "E" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1110")
- ElseIf chr = "F" Then
- new_drawing[y] = Text.Append(new_drawing[y], "1111")
- EndIf
- EndFor
- GraphicsWindow.Title = "Rendu graphique"
- GraphicsWindow.Width = SIZE * 8
- GraphicsWindow.Height = SIZE * 8
- GraphicsWindow.Show()
- For y = 0 To 7
- For x = 1 To 8
- If Text.GetSubText(new_drawing[y], x, 1) = "1" Then
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(x * SIZE - SIZE, y * SIZE, SIZE, SIZE)
- EndIf
- EndFor
- EndFor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement