DRAW2LGO |
DRAW du BASIC à Logo |
---|---|
DEV-COOLS |
Syntaxe
DRAW2LGO nomdufichier.BAS nomdufichier.LGO |
Description
Cette commande permet de convertir les chaînes de caractères DRAW du langage de programmation BASIC en instruction du langage de programmation LOGO.
Exemple
Supposons que vous le fichier de commandes DRAW suivant nommé «BOULE.BAS» :
BM160,59M163,58M168,60M172,61M175,64M176,67M176,68M173,72 M168,75M164,76M160,77M156,75M152,73M150,72M149,68M151,63M157,59 M160,59
BM174,69M176,72M177,76M176,78M175,80M173,83M169,78M165,85M166,85M163,86M160,87M152,85M148,86M144,85M139,85M137,83
BM150,72M148,77
BM135,83M139,84BM135,80M139,81
BM152,85M152,88M150,89M150,92
BM148,77M147,72M144,70M141,67M137,62M134,63M139,68M141,70M144,71
BM134,63M139,64BM138,62M131,66M130,64M135,59M133,59M129,61 M123,63M122,67M123,69M121,66M122,61BM118,64M117,66M120,70M122,71 M121,74M120,77M122,82M124,85M125,81M121,92M120,94M116,96M112,98 M108,100M104,102M102,104M99,107M97,111M97,114M98,116M100,120
BM100,120M102,122M104,124M108,126M112,127M116,126M120,123M123,120M124,116M126,112M128,104M129,96M130,91M129,90M128,85M130,83 BM129,90 M134,91M136,92M141,89M144,91M146,93M142,94M148,99
BM148,99M152,95M157,93M156,91M151,92M146,93
BM144,80M146,77BM144,77M146,74M144,73BM140,78M142,77BM141,78E0 BM140,76M142,76M141,75M139,74M139,76BM137,77M135,75
BM141,75M139,72M136,71M134,71M133,72M134,73BM138,70M137,69 M138,67BM131,74M128,72M128,69M131,67M133,69M131,70M131,72M131,74
BM138,90M139,92M138,97M135,101M132,107M130,109M130,113M133,117 M136,118M142,116M144,114M148,111
BM148,99M147,103M147,106BM150,101M147,106M148,109M148,111 M152,113M155,112M153,108BM155,112M160,113M163,109M164,108BM157,93 M163,94M168,96
BM168,96M166,100M164,99M163,109M168,112M171,112M174,108M175,102 M180,98M176,95M172,93M170,93M168,96BM175,107M179,112M182,115M183,120 M182,123M181,126M180,128
BM179,98M180,101M177,102BM180,101M181,105M181,107M179,109M175,108
BM176,123M175,123M175,124M177,124M178,122
BM177,126M174,127M168,126M165,120M164,116M164,114
BM151,113M152,115M151,120M150,123
BM148,123M157,121M162,122M165,123M164,126M163,128M157,132 M172,129M177,130M180,133M176,139M167,142M160,144M146,141M144,138 M147,134M144,131M146,125M148,123
BM177,136M172,132BM176,140M172,136
BM145,128M141,126M143,123M141,125M141,120M140,125M139,120 M139,124M135,123M137,126M135,131M136,134M140,136M144,137
BM182,123M185,124M184,126M182,127M187,130M187,133M183,137 M176,139
Et que vous lancer la commande suivante :
DRAW2LGO BOULE.BAS BOULE.LGO |
Vous aurez un fichier BOULE.LGO ressemblant à ceci :
- PENDOWN
- PENUP
- SETPOSITION 160 59
- PENDOWN
- SETPOSITION 163 58
- SETPOSITION 168 60
- SETPOSITION 172 61
- SETPOSITION 175 64
- SETPOSITION 176 67
- SETPOSITION 176 68
- SETPOSITION 173 72
- SETPOSITION 168 75
- SETPOSITION 164 76
- SETPOSITION 160 77
- SETPOSITION 156 75
- SETPOSITION 152 73
- SETPOSITION 150 72
- SETPOSITION 149 68
- SETPOSITION 151 63
- SETPOSITION 157 59
- SETPOSITION 160 59
- PENDOWN
- PENUP
- SETPOSITION 174 69
- PENDOWN
- SETPOSITION 176 72
- SETPOSITION 177 76
- SETPOSITION 176 78
- SETPOSITION 175 80
- SETPOSITION 173 83
- SETPOSITION 169 78
- SETPOSITION 165 85
- SETPOSITION 166 85
- SETPOSITION 163 86
- SETPOSITION 160 87
- SETPOSITION 152 85
- SETPOSITION 148 86
- SETPOSITION 144 85
- SETPOSITION 139 85
- SETPOSITION 137 83
- PENDOWN
- PENUP
- SETPOSITION 150 72
- PENDOWN
- SETPOSITION 148 77
- PENDOWN
- PENUP
- SETPOSITION 135 83
- PENDOWN
- SETPOSITION 139 84
- PENUP
- SETPOSITION 135 80
- PENDOWN
- SETPOSITION 139 81
- PENDOWN
- PENUP
- SETPOSITION 152 85
- PENDOWN
- SETPOSITION 152 88
- SETPOSITION 150 89
- SETPOSITION 150 92
- PENDOWN
- PENUP
- SETPOSITION 148 77
- PENDOWN
- SETPOSITION 147 72
- SETPOSITION 144 70
- SETPOSITION 141 67
- SETPOSITION 137 62
- SETPOSITION 134 63
- SETPOSITION 139 68
- SETPOSITION 141 70
- SETPOSITION 144 71
- PENDOWN
- PENUP
- SETPOSITION 134 63
- PENDOWN
- SETPOSITION 139 64
- PENUP
- SETPOSITION 138 62
- PENDOWN
- SETPOSITION 131 66
- SETPOSITION 130 64
- SETPOSITION 135 59
- SETPOSITION 133 59
- SETPOSITION 129 61
- SETPOSITION 123 63
- SETPOSITION 122 67
- SETPOSITION 123 69
- SETPOSITION 121 66
- SETPOSITION 122 61
- PENUP
- SETPOSITION 118 64
- PENDOWN
- SETPOSITION 117 66
- SETPOSITION 120 70
- SETPOSITION 122 71
- SETPOSITION 121 74
- SETPOSITION 120 77
- SETPOSITION 122 82
- SETPOSITION 124 85
- SETPOSITION 125 81
- SETPOSITION 121 92
- SETPOSITION 120 94
- SETPOSITION 116 96
- SETPOSITION 112 98
- SETPOSITION 108 100
- SETPOSITION 104 102
- SETPOSITION 102 104
- SETPOSITION 99 107
- SETPOSITION 97 111
- SETPOSITION 97 114
- SETPOSITION 98 116
- SETPOSITION 100 120
- PENDOWN
- PENUP
- SETPOSITION 100 120
- PENDOWN
- SETPOSITION 102 122
- SETPOSITION 104 124
- SETPOSITION 108 126
- SETPOSITION 112 127
- SETPOSITION 116 126
- SETPOSITION 120 123
- SETPOSITION 123 120
- SETPOSITION 124 116
- SETPOSITION 126 112
- SETPOSITION 128 104
- SETPOSITION 129 96
- SETPOSITION 130 91
- SETPOSITION 129 90
- SETPOSITION 128 85
- SETPOSITION 130 83
- PENUP
- SETPOSITION 129 90
- PENDOWN
- SETPOSITION 134 91
- SETPOSITION 136 92
- SETPOSITION 141 89
- SETPOSITION 144 91
- SETPOSITION 146 93
- SETPOSITION 142 94
- SETPOSITION 148 99
- PENDOWN
- PENUP
- SETPOSITION 148 99
- PENDOWN
- SETPOSITION 152 95
- SETPOSITION 157 93
- SETPOSITION 156 91
- SETPOSITION 151 92
- SETPOSITION 146 93
- PENDOWN
- PENUP
- SETPOSITION 144 80
- PENDOWN
- SETPOSITION 146 77
- PENUP
- SETPOSITION 144 77
- PENDOWN
- SETPOSITION 146 74
- SETPOSITION 144 73
- PENUP
- SETPOSITION 140 78
- PENDOWN
- SETPOSITION 142 77
- PENUP
- SETPOSITION 141 78
- PENDOWN
- ANGLE 45
- FORWARD 0
- ANGLE -45
- PENUP
- SETPOSITION 140 76
- PENDOWN
- SETPOSITION 142 76
- SETPOSITION 141 75
- SETPOSITION 139 74
- SETPOSITION 139 76
- PENUP
- SETPOSITION 137 77
- PENDOWN
- SETPOSITION 135 75
- PENDOWN
- PENUP
- SETPOSITION 141 75
- PENDOWN
- SETPOSITION 139 72
- SETPOSITION 136 71
- SETPOSITION 134 71
- SETPOSITION 133 72
- SETPOSITION 134 73
- PENUP
- SETPOSITION 138 70
- PENDOWN
- SETPOSITION 137 69
- SETPOSITION 138 67
- PENUP
- SETPOSITION 131 74
- PENDOWN
- SETPOSITION 128 72
- SETPOSITION 128 69
- SETPOSITION 131 67
- SETPOSITION 133 69
- SETPOSITION 131 70
- SETPOSITION 131 72
- SETPOSITION 131 74
- PENDOWN
- PENUP
- SETPOSITION 138 90
- PENDOWN
- SETPOSITION 139 92
- SETPOSITION 138 97
- SETPOSITION 135 101
- SETPOSITION 132 107
- SETPOSITION 130 109
- SETPOSITION 130 113
- SETPOSITION 133 117
- SETPOSITION 136 118
- SETPOSITION 142 116
- SETPOSITION 144 114
- SETPOSITION 148 111
- PENDOWN
- PENUP
- SETPOSITION 148 99
- PENDOWN
- SETPOSITION 147 103
- SETPOSITION 147 106
- PENUP
- SETPOSITION 150 101
- PENDOWN
- SETPOSITION 147 106
- SETPOSITION 148 109
- SETPOSITION 148 111
- SETPOSITION 152 113
- SETPOSITION 155 112
- SETPOSITION 153 108
- PENUP
- SETPOSITION 155 112
- PENDOWN
- SETPOSITION 160 113
- SETPOSITION 163 109
- SETPOSITION 164 108
- PENUP
- SETPOSITION 157 93
- PENDOWN
- SETPOSITION 163 94
- SETPOSITION 168 96
- PENDOWN
- PENUP
- SETPOSITION 168 96
- PENDOWN
- SETPOSITION 166 100
- SETPOSITION 164 99
- SETPOSITION 163 109
- SETPOSITION 168 112
- SETPOSITION 171 112
- SETPOSITION 174 108
- SETPOSITION 175 102
- SETPOSITION 180 98
- SETPOSITION 176 95
- SETPOSITION 172 93
- SETPOSITION 170 93
- SETPOSITION 168 96
- PENUP
- SETPOSITION 175 107
- PENDOWN
- SETPOSITION 179 112
- SETPOSITION 182 115
- SETPOSITION 183 120
- SETPOSITION 182 123
- SETPOSITION 181 126
- SETPOSITION 180 128
- PENDOWN
- PENUP
- SETPOSITION 179 98
- PENDOWN
- SETPOSITION 180 101
- SETPOSITION 177 102
- PENUP
- SETPOSITION 180 101
- PENDOWN
- SETPOSITION 181 105
- SETPOSITION 181 107
- SETPOSITION 179 109
- SETPOSITION 175 108
- PENDOWN
- PENUP
- SETPOSITION 176 123
- PENDOWN
- SETPOSITION 175 123
- SETPOSITION 175 124
- SETPOSITION 177 124
- SETPOSITION 178 122
- PENDOWN
- PENUP
- SETPOSITION 177 126
- PENDOWN
- SETPOSITION 174 127
- SETPOSITION 168 126
- SETPOSITION 165 120
- SETPOSITION 164 116
- SETPOSITION 164 114
- PENDOWN
- PENUP
- SETPOSITION 151 113
- PENDOWN
- SETPOSITION 152 115
- SETPOSITION 151 120
- SETPOSITION 150 123
- PENDOWN
- PENUP
- SETPOSITION 148 123
- PENDOWN
- SETPOSITION 157 121
- SETPOSITION 162 122
- SETPOSITION 165 123
- SETPOSITION 164 126
- SETPOSITION 163 128
- SETPOSITION 157 132
- SETPOSITION 172 129
- SETPOSITION 177 130
- SETPOSITION 180 133
- SETPOSITION 176 139
- SETPOSITION 167 142
- SETPOSITION 160 144
- SETPOSITION 146 141
- SETPOSITION 144 138
- SETPOSITION 147 134
- SETPOSITION 144 131
- SETPOSITION 146 125
- SETPOSITION 148 123
- PENDOWN
- PENUP
- SETPOSITION 177 136
- PENDOWN
- SETPOSITION 172 132
- PENUP
- SETPOSITION 176 140
- PENDOWN
- SETPOSITION 172 136
- PENDOWN
- PENUP
- SETPOSITION 145 128
- PENDOWN
- SETPOSITION 141 126
- SETPOSITION 143 123
- SETPOSITION 141 125
- SETPOSITION 141 120
- SETPOSITION 140 125
- SETPOSITION 139 120
- SETPOSITION 139 124
- SETPOSITION 135 123
- SETPOSITION 137 126
- SETPOSITION 135 131
- SETPOSITION 136 134
- SETPOSITION 140 136
- SETPOSITION 144 137
- PENDOWN
- PENUP
- SETPOSITION 182 123
- PENDOWN
- SETPOSITION 185 124
- SETPOSITION 184 126
- SETPOSITION 182 127
- SETPOSITION 187 130
- SETPOSITION 187 133
- SETPOSITION 183 137
- SETPOSITION 176 139
Ensuite, vous lancez la commande suivante :
LOGO BOULE.LGO |
et vous obtenir un résultat ressemblant à ceci :
Code source
Voici le code source Pascal de DRAW2LGO :
Lien | Langage de programmation |
---|---|
DRAW2LGO.PAS | Free Pascal, Turbo Pascal 7 |
Dernière mise à jour : Vendredi, le 21 Juillet 2023