Tips untuk bermain golf di Logo

9

Logo adalah bahasa pemrograman yang dirancang pada tahun 1967 yang memiliki potensi besar untuk membuat grafik dalam jumlah yang relatif sedikit dibandingkan dengan bahasa lain.

Logo adalah bahasa pemrograman pendidikan yang menggunakan Turtle Graphics .

Ada beberapa implementasi Logo yang menarik termasuk:

Selain itu, beberapa penerjemah Logo dapat ditemukan online.

Halaman ini dimaksudkan untuk menjadi pusat golf kode tentang implementasi bahasa pemrograman Logo.

masukkan deskripsi gambar di sini

Sumber: The Great Logo Adventure (1998) oleh Jim Muller

Grant Miller
sumber

Jawaban:

3

LibreLogo

Memperpendek Definisi Warna:

Hal ini didokumentasikan bahwa warna dapat didefinisikan oleh nama, identifier, nilai RGB, atau kode HEX.

Dalam sebagian besar kasus, jika Anda memiliki kesempatan untuk menggunakan pengidentifikasi untuk konstanta warna, itu biasanya merupakan pilihan terpendek.

Di sisi lain, fakta yang sedikit diketahui adalah bahwa Anda juga dapat menggunakan nilai desimal untuk menentukan warna, dan sesekali Anda dapat menyimpan byte.

Bagan Warna:

+------------------------------------------------------------------------+   +-------------+
| Name                | Identifier | RGB           | HEX      | Decimal  |   | Best Option |
|------------------------------------------------------------------------|   |-------------|
| "BLACK"             | [0]        | [0,0,0]       | 0x000000 | 0        |   | 0           |
| "SILVER"            | [1]        | [192,192,192] | 0xc0c0c0 | 12632256 |   | [1]         |
| "GRAY"/"GREY"       | [2]        | [128,128,128] | 0x808080 | 8421504  |   | [2]         |
| "WHITE"             | [3]        | [255,255,255] | 0xffffff | 16777215 |   | [3]         |
| "MAROON"            | [4]        | [128,0,0]     | 0x800000 | 8388608  |   | [4]         |
| "RED"               | [5]        | [255,0,0]     | 0xff0000 | 16711680 |   | [5]         |
| "PURPLE"            | [6]        | [128,0,128]   | 0x800080 | 8388736  |   | [6]         |
| "FUCHSIA"/"MAGENTA" | [7]        | [255,0,255]   | 0xff00ff | 16711935 |   | [7]         |
| "GREEN"             | [8]        | [0,128,0]     | 0x008000 | 32768    |   | [8]         |
| "LIME"              | [9]        | [0,255,0]     | 0x00ff00 | 65280    |   | [9]         |
| "OLIVE"             | [10]       | [128,128,0]   | 0x808000 | 8421376  |   | [10]        |
| "YELLOW"            | [11]       | [255,255,0]   | 0xffff00 | 16776960 |   | [11]        |
| "NAVY"              | [12]       | [0,0,128]     | 0x000080 | 128      |   | 128         |
| "BLUE"              | [13]       | [0,0,255]     | 0x0000ff | 255      |   | 255         |
| "TEAL"              | [14]       | [0,128,128]   | 0x008080 | 32896    |   | [14]        |
| "AQUA"              | [15]       | [0,255,255]   | 0x00ffff | 65535    |   | [15]        |
| "PINK"              | [16]       | [255,192,203] | 0xffc0cb | 16761035 |   | [16]        |
| "TOMATO"            | [17]       | [255,99,71]   | 0xff6347 | 16737095 |   | [17]        |
| "ORANGE"            | [18]       | [255,165,0]   | 0xffa500 | 16753920 |   | [18]        |
| "GOLD"              | [19]       | [255,215,0]   | 0xffd700 | 16766720 |   | [19]        |
| "VIOLET"            | [20]       | [148,0,211]   | 0x9400d3 | 9699539  |   | [20]        |
| "SKYBLUE"           | [21]       | [135,206,235] | 0x87ceeb | 8900331  |   | [21]        |
| "CHOCOLATE"         | [22]       | [210,105,30]  | 0xd2691e | 13789470 |   | [22]        |
| "BROWN"             | [23]       | [165,42,42]   | 0xa52a2a | 10824234 |   | [23]        |
| "INVISIBLE"         | [24]       | N/A           | N/A      | N/A      |   | [24]        |
+------------------------------------------------------------------------+   +-------------+
Grant Miller
sumber
2

LibreLogo

Gunakan Perintah Singkat:

Perintah singkat, juga disebut "nama pendek," digunakan di sebagian besar implementasi Logo.

Berikut adalah daftar lengkap perintah singkat untuk LibreLogo .

+-----------------------------------------------+
| Full Command    | Short Command | Bytes Saved |
|-----------------------------------------------|
| forward 10      | fd 10         | 5           |
| back 10         | bk 10         | 2           |
| left 90         | lt 90         | 2           |
| right 90        | rt 90         | 3           |
| penup           | pu            | 3           |
| pendown         | pd            | 5           |
| position 0      | pos 0         | 5           |
| heading 0       | seth 0        | 3           |
| hideturtle      | ht            | 8           |
| showturtle      | st            | 8           |
| clearscreen     | cs            | 9           |
| pensize 10      | ps 10         | 5           |
| pencolor 0      | pc 0          | 6           |
| fillcolor 0     | fc 0          | 7           |
| picture [ ... ] | pic [ ... ]   | 4           |
+-----------------------------------------------+
Grant Miller
sumber
0

LibreLogo

Angka acak:

Gunakan anyalih-alih randombila memungkinkan.

Integer Acak (0 - 9):

x = int random 10     ; 17 bytes
x = int(ps any)       ; 15 bytes

Nomor Titik Apung Acak (0 - 9):

x = random 10         ; 13 bytes
x = (ps any)          ; 12 bytes

Ditugaskan Langsung ke Pengaturan:

pensize random 10     ; 17 bytes
ps random 10          ; 12 bytes
ps any                ; 6 bytes
Grant Miller
sumber
0

LibreLogo

Gunakan PAGESIZEuntuk Keuntungan Anda:

PAGESIZEadalah variabel yang bergantung pada Format Kertas di LibreOffice Writer dan mengembalikan array yang berisi [width, height]halaman dalam poin ( pt).

Ini bisa berguna untuk berbagai situasi, tetapi saya pribadi menemukannya berguna untuk menghasilkan nomor tanpa menggunakan angka [0-9].

https://help.libreoffice.org/Writer/LibreLogo_Toolbar#PAGESIZE

masukkan deskripsi gambar di sini


Bagan Nilai:

+-------------------------------------------------------------------+
| Paper Format           | PAGESIZE                                 |
|-------------------------------------------------------------------|
| A6                     | [297.35433070866145, 419.75433070866137] |
| A5                     | [419.75433070866137, 595.4456692913386]  |
| A4                     | [595.4456692913386, 841.6913385826772]   |
| A3                     | [841.6913385826772, 1190.8913385826772]  |
| B6 (ISO)               | [354.2456692913386, 498.95433070866136]  |
| B5 (ISO)               | [498.95433070866136, 708.4913385826771]  |
| B4 (ISO)               | [708.4913385826771, 1000.8]              |
| Letter                 | [612.0, 792.0]                           |
| Legal                  | [612.0, 1008.0]                          |
| Long Bond              | [612.0, 936.0]                           |
| Tabloid                | [792.0, 1224.0]                          |
| B6 (JIS)               | [362.8913385826771, 516.2456692913386]   |
| B5 (JIS)               | [516.2456692913386, 728.6456692913387]   |
| B4 (JIS)               | [728.6456692913387, 1031.7543307086614]  |
| 16 Kai                 | [521.2913385826771, 737.2913385826771]   |
| 32 Kai                 | [368.64566929133855, 521.2913385826771]  |
| Big 32 Kai             | [396.7086614173228, 575.2913385826771]   |
| User                   | CURRENT PAGE SIZE                        | ← Current Paper Format
| DL Envelope            | [311.7543307086614, 623.5086614173229]   |
| C6 Envelope            | [323.29133858267716, 459.3543307086614]  |
| C6/5 Envelope          | [323.29133858267716, 649.4456692913386]  |
| C5 Envelope            | [459.3543307086614, 649.4456692913386]   |
| C4 Envelope            | [649.4456692913386, 918.7086614173228]   |
| #6¾ Envelope           | [261.35433070866145, 468.0]              |
| #7¾ (Monarch) Envelope | [279.35433070866145, 540.0]              |
| #9 Envelope            | [279.35433070866145, 639.3543307086613]  |
| #10 Envelope           | [297.35433070866145, 684.0]              |
| #11 Envelope           | [324.0, 747.3543307086613]               |
| #12 Envelope           | [342.0, 792.0]                           |
| Japanese Postcard      | [283.69133858267713, 419.75433070866137] |
+-------------------------------------------------------------------+
Grant Miller
sumber