[{"data":1,"prerenderedAt":341},["ShallowReactive",2],{"tag-labels":3,"site-header":4,"article-pascal-set-of-en":75},{},{"featuredPost":5,"navigations":29},{"id":6,"title":7,"title_id":8,"slug":9,"excerpt":10,"excerpt_id":11,"has_translation":12,"published_at":13,"reading_time":14,"hidden_from_listing":15,"tags":16,"thumbnail_image":21,"og_image":22,"series":23,"authors":28},110,"When You Pick a Framework Just to Look Different","Ketika Pilih Framework Cuma Biar Kelihatan Beda","ketika-pilih-framework-cuma-biar-kelihatan-beda","The last time you chose a new framework or library, was it because your problem needed that tool, or because it sounded cool and few people around you were using it? That question is uncomfortable. Technology decisions are often made for reasons that never appear in any technical document.","Terakhir kali kamu milih framework atau library baru, itu karena masalahmu butuh alat itu, atau karena alatnya kedengaran keren dan belum banyak yang pakai? Pertanyaan ini nggak enak dijawab. Soalnya keputusan teknologi sering diambil dengan alasan yang nggak pernah ditulis di dokumen teknis mana pun.",true,"2026-10-06T15:25:21.000Z",5,false,[17,18,19,20],"karier","framework","opini","pengalaman",null,"\u002Fog\u002Fketika-pilih-framework-cuma-biar-kelihatan-beda.png",{"id":24,"title":25,"title_id":26,"slug":27},9,"Articles","Artikel","all",[],[30,49,70],{"collection":31,"item":32},"series",{"__typename":31,"title":25,"title_id":26,"slug":27,"children_series":33},[34,38,42,46],{"title":35,"title_id":36,"slug":37},"Artificial Intelligence","Kecerdasan Artifisial","kecerdasan-artifisial",{"title":39,"title_id":40,"slug":41},"Programming Fundamentals","Konsep Dasar Pemrograman","konsep-dasar-pemrograman",{"title":43,"title_id":44,"slug":45},"Algorithms and Data Structures","Algoritma dan Struktur Data","algoritma-struktur-data",{"title":47,"title_id":47,"slug":48},"LLM Systems","llm-systems",{"collection":31,"item":50},{"__typename":31,"title":51,"title_id":51,"slug":52,"children_series":53},"Tutorial","tutorial",[54,58,62,66],{"title":55,"title_id":56,"slug":57},"Learning Python","Belajar Python","belajar-python",{"title":59,"title_id":60,"slug":61},"Learning Go","Belajar Golang","belajar-golang",{"title":63,"title_id":64,"slug":65},"Learning Java","Belajar Java","belajar-java",{"title":67,"title_id":68,"slug":69},"Learning Pascal","Belajar Pascal","belajar-pascal",{"collection":31,"item":71},{"__typename":31,"title":72,"title_id":72,"slug":73,"children_series":74},"Lab","lab",[],{"article":76,"renderedBody":215,"renderedTakeaway":216,"latestArticles":217,"toc":322},{"id":77,"title":78,"title_id":79,"slug":80,"excerpt":81,"excerpt_id":82,"has_translation":12,"published_at":83,"reading_time":84,"hidden_from_listing":15,"tags":85,"thumbnail_image":21,"og_image":89,"series":90,"authors":207,"seoTitle":21,"seoDescription":21,"body_locale":210,"available_locales":211,"body":213,"takeway":214,"prerequisite":21},145,"Pascal SET OF: Why >= Checks Subset Membership Instead of Size","Pascal SET OF: Kenapa `>=` Menguji Isi Himpunan, Bukan Ukurannya","pascal-set-of","Two absent lists, a program that prints both counts correctly, and then names the wrong class. Free Pascal refuses `>` on sets, and the `>=` that replaces it answers a different question.","Dua daftar absen, sebuah program yang mencetak kedua hitungannya dengan benar, lalu menyebut kelas yang salah. Free Pascal menolak `>` pada himpunan, dan `>=` yang menggantikannya menjawab pertanyaan yang lain.","2026-11-09T01:00:00.000Z",7,[86,87,88],"pascal","set","struktur-data","\u002Fog\u002Fpascal-set-of.png",{"id":91,"title":92,"title_id":93,"slug":94,"description":95,"description_id":96,"articles":97,"children_series":186,"parent_series":187},25,"Composite Types","Tipe Data Bentukan","pascal-tipe-data-bentukan","Types you build yourself: record, array, and the pointer that keeps confusing everyone at first.","Tipe data racikan sendiri: record, array, sampai pointer yang sering bikin pusing di awal.",[98,119,134,150,166,171],{"id":99,"title":100,"title_id":101,"slug":102,"excerpt":103,"excerpt_id":104,"has_translation":12,"published_at":105,"reading_time":106,"hidden_from_listing":15,"tags":107,"thumbnail_image":21,"og_image":110,"series":111,"authors":112},73,"User-Defined Data Types in Pascal","Tentang Tipe Data Bentukan pada Pascal","tentang-tipe-data-bentukan-pada-pascal","User-defined data types in Pascal come in 2 kinds, Enumerated and Subrange, and you declare both of them yourself.","Tipe data bentukan atau User defined data types terbagi menjadi 2, yaitu Enumerated dan Subrange","2020-11-22T13:49:03.000Z",3,[86,108,88,109],"tipe-data","konsep","\u002Fog\u002Ftentang-tipe-data-bentukan-pada-pascal.png",{"id":91,"title":92,"title_id":93,"slug":94},[113],{"authors_id":114},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},1,"Daffa Izzuddin","izzudd","Writer",{"id":120,"title":121,"title_id":122,"slug":123,"excerpt":124,"excerpt_id":125,"has_translation":12,"published_at":126,"reading_time":106,"hidden_from_listing":15,"tags":127,"thumbnail_image":21,"og_image":129,"series":130,"authors":131},74,"Using the RECORD Data Type in Pascal","Menggunakan Tipe Data RECORD pada Pascal","menggunakan-tipe-data-record-pada-pascal","RECORD is a structured data type in Pascal, built from a collection of standard and user-defined data types.","RECORD merupakan tipe data terstruktur pada bahasa Pascal yang terdiri dari kumpulan tipe data standar dan bentukan.","2020-11-27T13:54:30.000Z",[86,128,108,88],"record","\u002Fog\u002Fmenggunakan-tipe-data-record-pada-pascal.png",{"id":91,"title":92,"title_id":93,"slug":94},[132],{"authors_id":133},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":135,"title":136,"title_id":137,"slug":138,"excerpt":139,"excerpt_id":140,"has_translation":12,"published_at":141,"reading_time":142,"hidden_from_listing":15,"tags":143,"thumbnail_image":21,"og_image":145,"series":146,"authors":147},75,"Using the Array Data Type in Pascal","Menggunakan Tipe Data Array pada Pascal","menggunakan-tipe-data-array-pada-pascal","An ARRAY is a structure that holds a set of data with the same type, and you reach each item in it through its index.","ARRAY merupakan struktur data yang berisi sekumpulan data dengan tipe data yang sama. Data dalam ARRAY ini dapat diakses dengan menggunakan index.","2020-12-02T14:01:22.000Z",4,[86,144,108,88],"array","\u002Fog\u002Fmenggunakan-tipe-data-array-pada-pascal.png",{"id":91,"title":92,"title_id":93,"slug":94},[148],{"authors_id":149},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":151,"title":152,"title_id":153,"slug":154,"excerpt":155,"excerpt_id":156,"has_translation":12,"published_at":157,"reading_time":158,"hidden_from_listing":15,"tags":159,"thumbnail_image":21,"og_image":161,"series":162,"authors":163},76,"Using Pointers in Pascal","Menggunakan Pointer pada Bahasa Pascal","menggunakan-pointer-pada-bahasa-pascal","A variable of pointer type can only hold the address of another variable, and changing it changes that other variable.","Sebuah variable yang bertipe pointer nantinya hanya dapat berisi sebuah alamat dari variable lain.","2020-12-02T14:17:47.000Z",2,[86,160,108,109],"pointer","\u002Fog\u002Fmenggunakan-pointer-pada-bahasa-pascal.png",{"id":91,"title":92,"title_id":93,"slug":94},[164],{"authors_id":165},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":77,"title":78,"title_id":79,"slug":80,"excerpt":81,"excerpt_id":82,"has_translation":12,"published_at":83,"reading_time":84,"hidden_from_listing":15,"tags":85,"thumbnail_image":21,"og_image":89,"series":167,"authors":168},{"id":91,"title":92,"title_id":93,"slug":94},[169],{"authors_id":170},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":172,"title":173,"title_id":174,"slug":175,"excerpt":176,"excerpt_id":177,"has_translation":12,"published_at":178,"reading_time":179,"hidden_from_listing":15,"tags":180,"thumbnail_image":21,"og_image":181,"series":182,"authors":183},147,"Pascal Dynamic Arrays: the Sixth Score That Never Got Counted","Array Dinamis Pascal: Nilai Keenam yang Tidak Pernah Ikut Terhitung","pascal-dynamic-array","Six scores go in, five get counted, and the mean prints 78.0 because a fixed array stopped reading at MAX. `SetLength` gives the array the length the data asks for, and it also changes what assignment means.","Enam nilai masuk, lima yang terhitung, dan rata-ratanya tercetak 78.0 karena array tetap berhenti membaca di MAX. `SetLength` memberi array panjang yang diminta datanya, dan ia juga mengubah arti penugasan.","2026-11-11T01:00:00.000Z",8,[86,144,108],"\u002Fog\u002Fpascal-dynamic-array.png",{"id":91,"title":92,"title_id":93,"slug":94},[184],{"authors_id":185},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},[],{"id":188,"title":67,"title_id":68,"slug":69,"parent_series":189,"children_series":190},14,{"id":115,"title":51,"title_id":51,"slug":52},[191,196,201,202],{"id":192,"title":193,"title_id":194,"slug":195,"cover_image":21},23,"Getting Started with Pascal","Berkenalan dengan Bahasa Pascal","pascal-intro",{"id":197,"title":198,"title_id":199,"slug":200,"cover_image":21},24,"Control Structures","Struktur Kontrol","pascal-struktur-kontrol",{"id":91,"title":92,"title_id":93,"slug":94,"cover_image":21},{"id":203,"title":204,"title_id":205,"slug":206,"cover_image":21},26,"Procedural Programming","Pemrograman Prosedural","pascal-pemrograman-prosedural",[208],{"authors_id":209},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},"en",[210,212],"id","\nA small Pascal program prints `Class A: 3 absent` and `Class B: 2 absent`, and then announces that Class B has more absentees. Both counts are right and the verdict is wrong. The program compiled without a single warning, because the comparison you reached for from your array habits is legal Pascal that means something else. This tutorial uses Free Pascal 3.2.2 on Linux, and it assumes you have finished [arrays](\u002Fp\u002Fmenggunakan-tipe-data-array-pada-pascal) and [records](\u002Fp\u002Fmenggunakan-tipe-data-record-pada-pascal).\n\n## What a set keeps and what it drops\n\nA `SET OF` answers exactly one question: is this value a member? It keeps no order, no duplicates and no count. An array gives you positions and a length, so a set feels thin by comparison, and that thinness is the point.\n\nThe base type must be an ordinal, such as a small integer range or `char`. Free Pascal stores the set as a mask with one bit per possible value, and the size depends on how many values the type allows, not on how many you put in:\n\n| Declaration | `sizeof` |\n|---|---|\n| `set of 0..9` | 4 bytes |\n| `set of 0..31` | 4 bytes |\n| `set of 0..32` | 32 bytes |\n| `set of 1..40` | 32 bytes |\n| `set of char` | 32 bytes |\n\nUp to 32 possible values the set is a 4-byte mask. One value more and it is 32 bytes. Notice that nothing in the table is a count of members, and Pascal gives a set no `Length`.\n\n## Adding, removing, testing\n\n`Include` adds a value, `Exclude` removes one, and `in` tests membership. This program checks its own results, so every line should print `TRUE` or `FALSE`:\n\n```pascal\nprogram edit;\n\nvar\n  present: set of 1..40;\n\nbegin\n  present := [1..5];\n  Include(present, 7);\n  Include(present, 12);\n  Include(present, 12);\n  writeln('added 7, 12, 12 to [1..5]  : ', present = [1, 2, 3, 4, 5, 7, 12]);\n  Exclude(present, 3);\n  writeln('after Exclude(present, 3)  : ', present = [1, 2, 4, 5, 7, 12]);\n  writeln('is 7 present               : ', 7 in present);\n  writeln('is 3 present               : ', 3 in present);\n  writeln('present - [1, 2] = [4,5,7,12]: ', present - [1, 2] = [4, 5, 7, 12]);\nend.\n```\n\n```plain\n$ fpc edit.pas && .\u002Fedit\nadded 7, 12, 12 to [1..5]  : TRUE\nafter Exclude(present, 3)  : TRUE\nis 7 present               : TRUE\nis 3 present               : FALSE\npresent - [1, 2] = [4,5,7,12]: TRUE\n```\n\nIncluding 12 twice changed nothing, because a set records only whether a value is present, not how many times you added it. `Include` and `Exclude` edit one value in place, while `+` and `-` do the same job to whole sets.\n\n## The comparison that is not a count\n\nComing from arrays, you will want to ask which absent list is bigger. Try it:\n\n```pascal\nprogram compare;\n\nvar\n  absentA, absentB: set of 1..40;\n\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n  if absentA > absentB then\n    writeln('Class A has more absentees');\nend.\n```\n\n```plain\n$ fpc compare.pas\ncompare.pas(9,14) Error: Operation not implemented for sets\ncompare.pas(12) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\n```\n\nGood: the compiler refuses. The trap is the next move, which is to try `>=` instead. That compiles, because `>=`, `\u003C=`, `=` and `\u003C>` all exist on sets. With `a` as `[1, 2, 3]`, `b` as `[5, 6]` and `c` as `[1, 2]`, I measured `a >= b` as `FALSE`, `a \u003C= b` as `FALSE`, `a = b` as `FALSE`, `a \u003C> b` as `TRUE` and `c \u003C= a` as `TRUE`.\n\nRead the last one: `c \u003C= a` is true because every element of `c` is also in `a`. So `>=` means \"contains every element of\", not \"has more elements\". Here `a >= b` is false because `a` lacks 5 and 6, which says nothing about which list is longer.\n\n## Two files, one command\n\nHere is the starter program. It counts correctly and then compares the sets themselves:\n\n```pascal\nprogram attendance;\n\ntype\n  ClassSet = set of 1..40;\n\nfunction Count(k: ClassSet): integer;\nvar\n  i: integer;\nbegin\n  Count := 0;\n  for i := 1 to 40 do\n    if i in k then\n      Count := Count + 1;\nend;\n\nvar\n  absentA, absentB: ClassSet;\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n\n  writeln('Class A: ', Count(absentA), ' absent');\n  writeln('Class B: ', Count(absentB), ' absent');\n\n  if absentA >= absentB then\n    writeln('Class A has more absentees')\n  else\n    writeln('Class B has more absentees');\nend.\n```\n\n`Count` is the loop that stands in for the missing `Length`: it walks the base type and tests each value. Rather than trusting your eyes, save this checker as `check_attendance.pas` and compile it once with `fpc check_attendance.pas`:\n\n```pascal\nprogram check_attendance;\n\nvar\n  expected: array[1..3] of string;\n  line: string;\n  i, passed, failed: integer;\n\nbegin\n  expected[1] := 'Class A: 3 absent';\n  expected[2] := 'Class B: 2 absent';\n  expected[3] := 'Class A has more absentees';\n\n  passed := 0;\n  failed := 0;\n  i := 0;\n\n  while not eof do\n  begin\n    readln(line);\n    i := i + 1;\n    if i \u003C= 3 then\n    begin\n      if line = expected[i] then\n      begin\n        writeln('PASS  line ', i, ': ', expected[i]);\n        passed := passed + 1;\n      end\n      else\n      begin\n        writeln('FAIL  line ', i, ': expected \"', expected[i], '\", got \"', line, '\"');\n        failed := failed + 1;\n      end;\n    end;\n  end;\n\n  if i \u003C 3 then\n  begin\n    writeln('FAIL  the program printed ', i, ' lines, expected 3');\n    failed := failed + 1;\n  end;\n\n  writeln;\n  writeln(passed, ' of 3 checks passed');\n\n  if failed > 0 then\n    ExitCode := 1;\nend.\n```\n\nNow `fpc attendance.pas` writes the binary `attendance` next to the source, and one command pipes it into the checker:\n\n```plain\n$ .\u002Fattendance | .\u002Fcheck_attendance\nPASS  line 1: Class A: 3 absent\nPASS  line 2: Class B: 2 absent\nFAIL  line 3: expected \"Class A has more absentees\", got \"Class B has more absentees\"\n\n2 of 3 checks passed\n```\n\nThe counts pass and the verdict fails. The fix is one line: compare the counts, not the sets. The rest of the file is unchanged:\n\n```pascal\nprogram attendance;\n\ntype\n  ClassSet = set of 1..40;\n\nfunction Count(k: ClassSet): integer;\nvar\n  i: integer;\nbegin\n  Count := 0;\n  for i := 1 to 40 do\n    if i in k then\n      Count := Count + 1;\nend;\n\nvar\n  absentA, absentB: ClassSet;\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n\n  writeln('Class A: ', Count(absentA), ' absent');\n  writeln('Class B: ', Count(absentB), ' absent');\n\n  if Count(absentA) > Count(absentB) then\n    writeln('Class A has more absentees')\n  else\n    writeln('Class B has more absentees');\nend.\n```\n\n```plain\n$ .\u002Fattendance | .\u002Fcheck_attendance\nPASS  line 1: Class A: 3 absent\nPASS  line 2: Class B: 2 absent\nPASS  line 3: Class A has more absentees\n\n3 of 3 checks passed\n```\n\n## Where sets stop\n\nA set base type must be an ordinal that fits in 0..255. Declare a wider range and the compiler stops you:\n\n```pascal\nprogram limit;\n\nvar\n  present: set of 0..999;\n\nbegin\n  present := [];\nend.\n```\n\n```plain\n$ fpc limit.pas\nlimit.pas(4,25) Error: illegal type declaration of set elements\nlimit.pas(9) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\n```\n\nSo student IDs above 255 do not belong in a set. Use an `array of boolean` indexed by the ID instead, and count its `TRUE` entries with the same kind of loop. If your members are characters, `set of char` works, and you test the character itself with `in`.\n\n## Break it on purpose\n\nAdd student 4 to `absentA` with `absentA := [1, 2, 3, 4];` and the checker fails line 1, because the count is now 4. Then put `if absentA >= absentB then` back, and line 3 goes red again.\n\nUse a set when the question is whether a value is in a group, and compare sets with `>=` only when you mean \"contains all of\". When the question is how many, loop, count, and compare the counts.\n","- A `SET OF` answers membership, not order and not size: `>=` asks whether one set contains every element of the other.\n- Free Pascal refuses `>` and `\u003C` on sets with `Error: Operation not implemented for sets`, so the wrong question usually reaches the compiler as `>=` and compiles.\n- Counting the entries in a set takes a loop over its base type; Pascal gives a set no `Length`.\n- A set is a 4-byte mask up to 32 elements and 32 bytes above that, whatever range you declared.\n- The base type has to be an ordinal in 0..255, so student IDs above 255 belong in an array, not a set.","\u003Cp>A small Pascal program prints \u003Ccode>Class A: 3 absent\u003C\u002Fcode> and \u003Ccode>Class B: 2 absent\u003C\u002Fcode>, and then announces that Class B has more absentees. Both counts are right and the verdict is wrong. The program compiled without a single warning, because the comparison you reached for from your array habits is legal Pascal that means something else. This tutorial uses Free Pascal 3.2.2 on Linux, and it assumes you have finished \u003Ca href=\"\u002Fp\u002Fmenggunakan-tipe-data-array-pada-pascal\">arrays\u003C\u002Fa> and \u003Ca href=\"\u002Fp\u002Fmenggunakan-tipe-data-record-pada-pascal\">records\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"what-a-set-keeps-and-what-it-drops\">What a set keeps and what it drops\u003C\u002Fh2>\n\u003Cp>A \u003Ccode>SET OF\u003C\u002Fcode> answers exactly one question: is this value a member? It keeps no order, no duplicates and no count. An array gives you positions and a length, so a set feels thin by comparison, and that thinness is the point.\u003C\u002Fp>\n\u003Cp>The base type must be an ordinal, such as a small integer range or \u003Ccode>char\u003C\u002Fcode>. Free Pascal stores the set as a mask with one bit per possible value, and the size depends on how many values the type allows, not on how many you put in:\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Declaration\u003C\u002Fth>\n\u003Cth>\u003Ccode>sizeof\u003C\u002Fcode>\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>set of 0..9\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>4 bytes\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>set of 0..31\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>4 bytes\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>set of 0..32\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>32 bytes\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>set of 1..40\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>32 bytes\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>set of char\u003C\u002Fcode>\u003C\u002Ftd>\n\u003Ctd>32 bytes\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\u003C\u002Ftable>\n\u003Cp>Up to 32 possible values the set is a 4-byte mask. One value more and it is 32 bytes. Notice that nothing in the table is a count of members, and Pascal gives a set no \u003Ccode>Length\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"adding-removing-testing\">Adding, removing, testing\u003C\u002Fh2>\n\u003Cp>\u003Ccode>Include\u003C\u002Fcode> adds a value, \u003Ccode>Exclude\u003C\u002Fcode> removes one, and \u003Ccode>in\u003C\u002Fcode> tests membership. This program checks its own results, so every line should print \u003Ccode>TRUE\u003C\u002Fcode> or \u003Ccode>FALSE\u003C\u002Fcode>:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20edit%3B%0A%0Avar%0A%20%20present%3A%20set%20of%201..40%3B%0A%0Abegin%0A%20%20present%20%3A%3D%20%5B1..5%5D%3B%0A%20%20Include(present%2C%207)%3B%0A%20%20Include(present%2C%2012)%3B%0A%20%20Include(present%2C%2012)%3B%0A%20%20writeln('added%207%2C%2012%2C%2012%20to%20%5B1..5%5D%20%20%3A%20'%2C%20present%20%3D%20%5B1%2C%202%2C%203%2C%204%2C%205%2C%207%2C%2012%5D)%3B%0A%20%20Exclude(present%2C%203)%3B%0A%20%20writeln('after%20Exclude(present%2C%203)%20%20%3A%20'%2C%20present%20%3D%20%5B1%2C%202%2C%204%2C%205%2C%207%2C%2012%5D)%3B%0A%20%20writeln('is%207%20present%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20'%2C%207%20in%20present)%3B%0A%20%20writeln('is%203%20present%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20'%2C%203%20in%20present)%3B%0A%20%20writeln('present%20-%20%5B1%2C%202%5D%20%3D%20%5B4%2C5%2C7%2C12%5D%3A%20'%2C%20present%20-%20%5B1%2C%202%5D%20%3D%20%5B4%2C%205%2C%207%2C%2012%5D)%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program edit;\n\nvar\n  present: set of 1..40;\n\nbegin\n  present := [1..5];\n  Include(present, 7);\n  Include(present, 12);\n  Include(present, 12);\n  writeln('added 7, 12, 12 to [1..5]  : ', present = [1, 2, 3, 4, 5, 7, 12]);\n  Exclude(present, 3);\n  writeln('after Exclude(present, 3)  : ', present = [1, 2, 4, 5, 7, 12]);\n  writeln('is 7 present               : ', 7 in present);\n  writeln('is 3 present               : ', 3 in present);\n  writeln('present - [1, 2] = [4,5,7,12]: ', present - [1, 2] = [4, 5, 7, 12]);\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20edit.pas%20%26%26%20.%2Fedit%0Aadded%207%2C%2012%2C%2012%20to%20%5B1..5%5D%20%20%3A%20TRUE%0Aafter%20Exclude(present%2C%203)%20%20%3A%20TRUE%0Ais%207%20present%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20TRUE%0Ais%203%20present%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20FALSE%0Apresent%20-%20%5B1%2C%202%5D%20%3D%20%5B4%2C5%2C7%2C12%5D%3A%20TRUE\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc edit.pas &amp;&amp; .\u002Fedit\u003C\u002Fspan>\nadded 7, 12, 12 to [1..5]  : TRUE\nafter Exclude(present, 3)  : TRUE\nis 7 present               : TRUE\nis 3 present               : FALSE\npresent - [1, 2] = [4,5,7,12]: TRUE\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Including 12 twice changed nothing, because a set records only whether a value is present, not how many times you added it. \u003Ccode>Include\u003C\u002Fcode> and \u003Ccode>Exclude\u003C\u002Fcode> edit one value in place, while \u003Ccode>+\u003C\u002Fcode> and \u003Ccode>-\u003C\u002Fcode> do the same job to whole sets.\u003C\u002Fp>\n\u003Ch2 id=\"the-comparison-that-is-not-a-count\">The comparison that is not a count\u003C\u002Fh2>\n\u003Cp>Coming from arrays, you will want to ask which absent list is bigger. Try it:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20compare%3B%0A%0Avar%0A%20%20absentA%2C%20absentB%3A%20set%20of%201..40%3B%0A%0Abegin%0A%20%20absentA%20%3A%3D%20%5B1%2C%202%2C%203%5D%3B%0A%20%20absentB%20%3A%3D%20%5B5%2C%206%5D%3B%0A%20%20if%20absentA%20%3E%20absentB%20then%0A%20%20%20%20writeln('Class%20A%20has%20more%20absentees')%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program compare;\n\nvar\n  absentA, absentB: set of 1..40;\n\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n  if absentA &gt; absentB then\n    writeln('Class A has more absentees');\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20compare.pas%0Acompare.pas(9%2C14)%20Error%3A%20Operation%20not%20implemented%20for%20sets%0Acompare.pas(12)%20Fatal%3A%20There%20were%201%20errors%20compiling%20module%2C%20stopping%0AFatal%3A%20Compilation%20aborted\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc compare.pas\u003C\u002Fspan>\ncompare.pas(9,14) Error: Operation not implemented for sets\ncompare.pas(12) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Good: the compiler refuses. The trap is the next move, which is to try \u003Ccode>&gt;=\u003C\u002Fcode> instead. That compiles, because \u003Ccode>&gt;=\u003C\u002Fcode>, \u003Ccode>&lt;=\u003C\u002Fcode>, \u003Ccode>=\u003C\u002Fcode> and \u003Ccode>&lt;&gt;\u003C\u002Fcode> all exist on sets. With \u003Ccode>a\u003C\u002Fcode> as \u003Ccode>[1, 2, 3]\u003C\u002Fcode>, \u003Ccode>b\u003C\u002Fcode> as \u003Ccode>[5, 6]\u003C\u002Fcode> and \u003Ccode>c\u003C\u002Fcode> as \u003Ccode>[1, 2]\u003C\u002Fcode>, I measured \u003Ccode>a &gt;= b\u003C\u002Fcode> as \u003Ccode>FALSE\u003C\u002Fcode>, \u003Ccode>a &lt;= b\u003C\u002Fcode> as \u003Ccode>FALSE\u003C\u002Fcode>, \u003Ccode>a = b\u003C\u002Fcode> as \u003Ccode>FALSE\u003C\u002Fcode>, \u003Ccode>a &lt;&gt; b\u003C\u002Fcode> as \u003Ccode>TRUE\u003C\u002Fcode> and \u003Ccode>c &lt;= a\u003C\u002Fcode> as \u003Ccode>TRUE\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>Read the last one: \u003Ccode>c &lt;= a\u003C\u002Fcode> is true because every element of \u003Ccode>c\u003C\u002Fcode> is also in \u003Ccode>a\u003C\u002Fcode>. So \u003Ccode>&gt;=\u003C\u002Fcode> means &quot;contains every element of&quot;, not &quot;has more elements&quot;. Here \u003Ccode>a &gt;= b\u003C\u002Fcode> is false because \u003Ccode>a\u003C\u002Fcode> lacks 5 and 6, which says nothing about which list is longer.\u003C\u002Fp>\n\u003Ch2 id=\"two-files-one-command\">Two files, one command\u003C\u002Fh2>\n\u003Cp>Here is the starter program. It counts correctly and then compares the sets themselves:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20attendance%3B%0A%0Atype%0A%20%20ClassSet%20%3D%20set%20of%201..40%3B%0A%0Afunction%20Count(k%3A%20ClassSet)%3A%20integer%3B%0Avar%0A%20%20i%3A%20integer%3B%0Abegin%0A%20%20Count%20%3A%3D%200%3B%0A%20%20for%20i%20%3A%3D%201%20to%2040%20do%0A%20%20%20%20if%20i%20in%20k%20then%0A%20%20%20%20%20%20Count%20%3A%3D%20Count%20%2B%201%3B%0Aend%3B%0A%0Avar%0A%20%20absentA%2C%20absentB%3A%20ClassSet%3B%0Abegin%0A%20%20absentA%20%3A%3D%20%5B1%2C%202%2C%203%5D%3B%0A%20%20absentB%20%3A%3D%20%5B5%2C%206%5D%3B%0A%0A%20%20writeln('Class%20A%3A%20'%2C%20Count(absentA)%2C%20'%20absent')%3B%0A%20%20writeln('Class%20B%3A%20'%2C%20Count(absentB)%2C%20'%20absent')%3B%0A%0A%20%20if%20absentA%20%3E%3D%20absentB%20then%0A%20%20%20%20writeln('Class%20A%20has%20more%20absentees')%0A%20%20else%0A%20%20%20%20writeln('Class%20B%20has%20more%20absentees')%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program attendance;\n\ntype\n  ClassSet = set of 1..40;\n\nfunction Count(k: ClassSet): integer;\nvar\n  i: integer;\nbegin\n  Count := 0;\n  for i := 1 to 40 do\n    if i in k then\n      Count := Count + 1;\nend;\n\nvar\n  absentA, absentB: ClassSet;\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n\n  writeln('Class A: ', Count(absentA), ' absent');\n  writeln('Class B: ', Count(absentB), ' absent');\n\n  if absentA &gt;= absentB then\n    writeln('Class A has more absentees')\n  else\n    writeln('Class B has more absentees');\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>\u003Ccode>Count\u003C\u002Fcode> is the loop that stands in for the missing \u003Ccode>Length\u003C\u002Fcode>: it walks the base type and tests each value. Rather than trusting your eyes, save this checker as \u003Ccode>check_attendance.pas\u003C\u002Fcode> and compile it once with \u003Ccode>fpc check_attendance.pas\u003C\u002Fcode>:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20check_attendance%3B%0A%0Avar%0A%20%20expected%3A%20array%5B1..3%5D%20of%20string%3B%0A%20%20line%3A%20string%3B%0A%20%20i%2C%20passed%2C%20failed%3A%20integer%3B%0A%0Abegin%0A%20%20expected%5B1%5D%20%3A%3D%20'Class%20A%3A%203%20absent'%3B%0A%20%20expected%5B2%5D%20%3A%3D%20'Class%20B%3A%202%20absent'%3B%0A%20%20expected%5B3%5D%20%3A%3D%20'Class%20A%20has%20more%20absentees'%3B%0A%0A%20%20passed%20%3A%3D%200%3B%0A%20%20failed%20%3A%3D%200%3B%0A%20%20i%20%3A%3D%200%3B%0A%0A%20%20while%20not%20eof%20do%0A%20%20begin%0A%20%20%20%20readln(line)%3B%0A%20%20%20%20i%20%3A%3D%20i%20%2B%201%3B%0A%20%20%20%20if%20i%20%3C%3D%203%20then%0A%20%20%20%20begin%0A%20%20%20%20%20%20if%20line%20%3D%20expected%5Bi%5D%20then%0A%20%20%20%20%20%20begin%0A%20%20%20%20%20%20%20%20writeln('PASS%20%20line%20'%2C%20i%2C%20'%3A%20'%2C%20expected%5Bi%5D)%3B%0A%20%20%20%20%20%20%20%20passed%20%3A%3D%20passed%20%2B%201%3B%0A%20%20%20%20%20%20end%0A%20%20%20%20%20%20else%0A%20%20%20%20%20%20begin%0A%20%20%20%20%20%20%20%20writeln('FAIL%20%20line%20'%2C%20i%2C%20'%3A%20expected%20%22'%2C%20expected%5Bi%5D%2C%20'%22%2C%20got%20%22'%2C%20line%2C%20'%22')%3B%0A%20%20%20%20%20%20%20%20failed%20%3A%3D%20failed%20%2B%201%3B%0A%20%20%20%20%20%20end%3B%0A%20%20%20%20end%3B%0A%20%20end%3B%0A%0A%20%20if%20i%20%3C%203%20then%0A%20%20begin%0A%20%20%20%20writeln('FAIL%20%20the%20program%20printed%20'%2C%20i%2C%20'%20lines%2C%20expected%203')%3B%0A%20%20%20%20failed%20%3A%3D%20failed%20%2B%201%3B%0A%20%20end%3B%0A%0A%20%20writeln%3B%0A%20%20writeln(passed%2C%20'%20of%203%20checks%20passed')%3B%0A%0A%20%20if%20failed%20%3E%200%20then%0A%20%20%20%20ExitCode%20%3A%3D%201%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program check_attendance;\n\nvar\n  expected: array[1..3] of string;\n  line: string;\n  i, passed, failed: integer;\n\nbegin\n  expected[1] := 'Class A: 3 absent';\n  expected[2] := 'Class B: 2 absent';\n  expected[3] := 'Class A has more absentees';\n\n  passed := 0;\n  failed := 0;\n  i := 0;\n\n  while not eof do\n  begin\n    readln(line);\n    i := i + 1;\n    if i &lt;= 3 then\n    begin\n      if line = expected[i] then\n      begin\n        writeln('PASS  line ', i, ': ', expected[i]);\n        passed := passed + 1;\n      end\n      else\n      begin\n        writeln('FAIL  line ', i, ': expected \"', expected[i], '\", got \"', line, '\"');\n        failed := failed + 1;\n      end;\n    end;\n  end;\n\n  if i &lt; 3 then\n  begin\n    writeln('FAIL  the program printed ', i, ' lines, expected 3');\n    failed := failed + 1;\n  end;\n\n  writeln;\n  writeln(passed, ' of 3 checks passed');\n\n  if failed &gt; 0 then\n    ExitCode := 1;\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>Now \u003Ccode>fpc attendance.pas\u003C\u002Fcode> writes the binary \u003Ccode>attendance\u003C\u002Fcode> next to the source, and one command pipes it into the checker:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20.%2Fattendance%20%7C%20.%2Fcheck_attendance%0APASS%20%20line%201%3A%20Class%20A%3A%203%20absent%0APASS%20%20line%202%3A%20Class%20B%3A%202%20absent%0AFAIL%20%20line%203%3A%20expected%20%22Class%20A%20has%20more%20absentees%22%2C%20got%20%22Class%20B%20has%20more%20absentees%22%0A%0A2%20of%203%20checks%20passed\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ .\u002Fattendance | .\u002Fcheck_attendance\u003C\u002Fspan>\nPASS  line 1: Class A: 3 absent\nPASS  line 2: Class B: 2 absent\nFAIL  line 3: expected \"Class A has more absentees\", got \"Class B has more absentees\"\n\n2 of 3 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>The counts pass and the verdict fails. The fix is one line: compare the counts, not the sets. The rest of the file is unchanged:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20attendance%3B%0A%0Atype%0A%20%20ClassSet%20%3D%20set%20of%201..40%3B%0A%0Afunction%20Count(k%3A%20ClassSet)%3A%20integer%3B%0Avar%0A%20%20i%3A%20integer%3B%0Abegin%0A%20%20Count%20%3A%3D%200%3B%0A%20%20for%20i%20%3A%3D%201%20to%2040%20do%0A%20%20%20%20if%20i%20in%20k%20then%0A%20%20%20%20%20%20Count%20%3A%3D%20Count%20%2B%201%3B%0Aend%3B%0A%0Avar%0A%20%20absentA%2C%20absentB%3A%20ClassSet%3B%0Abegin%0A%20%20absentA%20%3A%3D%20%5B1%2C%202%2C%203%5D%3B%0A%20%20absentB%20%3A%3D%20%5B5%2C%206%5D%3B%0A%0A%20%20writeln('Class%20A%3A%20'%2C%20Count(absentA)%2C%20'%20absent')%3B%0A%20%20writeln('Class%20B%3A%20'%2C%20Count(absentB)%2C%20'%20absent')%3B%0A%0A%20%20if%20Count(absentA)%20%3E%20Count(absentB)%20then%0A%20%20%20%20writeln('Class%20A%20has%20more%20absentees')%0A%20%20else%0A%20%20%20%20writeln('Class%20B%20has%20more%20absentees')%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program attendance;\n\ntype\n  ClassSet = set of 1..40;\n\nfunction Count(k: ClassSet): integer;\nvar\n  i: integer;\nbegin\n  Count := 0;\n  for i := 1 to 40 do\n    if i in k then\n      Count := Count + 1;\nend;\n\nvar\n  absentA, absentB: ClassSet;\nbegin\n  absentA := [1, 2, 3];\n  absentB := [5, 6];\n\n  writeln('Class A: ', Count(absentA), ' absent');\n  writeln('Class B: ', Count(absentB), ' absent');\n\n  if Count(absentA) &gt; Count(absentB) then\n    writeln('Class A has more absentees')\n  else\n    writeln('Class B has more absentees');\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20.%2Fattendance%20%7C%20.%2Fcheck_attendance%0APASS%20%20line%201%3A%20Class%20A%3A%203%20absent%0APASS%20%20line%202%3A%20Class%20B%3A%202%20absent%0APASS%20%20line%203%3A%20Class%20A%20has%20more%20absentees%0A%0A3%20of%203%20checks%20passed\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ .\u002Fattendance | .\u002Fcheck_attendance\u003C\u002Fspan>\nPASS  line 1: Class A: 3 absent\nPASS  line 2: Class B: 2 absent\nPASS  line 3: Class A has more absentees\n\n3 of 3 checks passed\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Ch2 id=\"where-sets-stop\">Where sets stop\u003C\u002Fh2>\n\u003Cp>A set base type must be an ordinal that fits in 0..255. Declare a wider range and the compiler stops you:\u003C\u002Fp>\n\n\u003Cdiv class=\"code-block-wrapper my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden bg-[#24292e] text-[#e1e4e8] transition-all\">\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ff5f56] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#ffbd2e] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"w-3 h-3 rounded-full bg-[#27c93f] border border-black\u002F40 inline-block\">\u003C\u002Fspan>\n      \u003Cspan class=\"ml-2 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">PASCAL\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"program%20limit%3B%0A%0Avar%0A%20%20present%3A%20set%20of%200..999%3B%0A%0Abegin%0A%20%20present%20%3A%3D%20%5B%5D%3B%0Aend.\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed bg-[#24292e]\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>program limit;\n\nvar\n  present: set of 0..999;\n\nbegin\n  present := [];\nend.\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\u003Cdiv class=\"code-block-wrapper code-output my-6 not-prose rounded-xl border-2 border-black dark:border-gray-600 shadow-neo overflow-hidden text-[#e1e4e8] transition-all\" data-output-block>\n  \u003Cdiv class=\"code-block-header flex items-center justify-between px-4 py-2.5 bg-[#1f2428] border-b-2 border-black dark:border-gray-600 font-mono text-xs font-bold text-gray-300 select-none\">\n    \u003Cdiv class=\"flex items-center gap-2\">\n      \u003Cspan class=\"code-output-mark\" aria-hidden=\"true\">&gt;_\u003C\u002Fspan>\n      \u003Cspan class=\"ml-1 font-mono font-bold text-xs uppercase tracking-wider text-gray-300\">Output\u003C\u002Fspan>\n    \u003C\u002Fdiv>\n    \u003Cbutton type=\"button\" class=\"copy-code-btn flex items-center gap-1.5 px-3 py-1 text-xs font-bold bg-[#2f363d] text-gray-200 border-2 border-black dark:border-gray-500 rounded-lg shadow-neo-sm hover:translate-x-0.5 hover:translate-y-0.5 hover:shadow-none hover:bg-gray-700 transition-all cursor-pointer\" data-code=\"%24%20fpc%20limit.pas%0Alimit.pas(4%2C25)%20Error%3A%20illegal%20type%20declaration%20of%20set%20elements%0Alimit.pas(9)%20Fatal%3A%20There%20were%201%20errors%20compiling%20module%2C%20stopping%0AFatal%3A%20Compilation%20aborted\" title=\"Copy\">\n      \u003Csvg class=\"w-3.5 h-3.5 copy-icon-svg\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n        \u003Cpath stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z\">\u003C\u002Fpath>\n      \u003C\u002Fsvg>\n      \u003Cspan class=\"copy-text\">Copy\u003C\u002Fspan>\n    \u003C\u002Fbutton>\n  \u003C\u002Fdiv>\n  \u003Cdiv class=\"code-block-content p-4 overflow-x-auto text-sm font-mono leading-relaxed\">\n    \u003Cpre class=\"shiki github-dark\" style=\"background-color:#24292e;color:#e1e4e8\">\u003Ccode>\u003Cspan class=\"code-output-cmd\">$ fpc limit.pas\u003C\u002Fspan>\nlimit.pas(4,25) Error: illegal type declaration of set elements\nlimit.pas(9) Fatal: There were 1 errors compiling module, stopping\nFatal: Compilation aborted\u003C\u002Fcode>\u003C\u002Fpre>\n  \u003C\u002Fdiv>\n\u003C\u002Fdiv>\u003Cp>So student IDs above 255 do not belong in a set. Use an \u003Ccode>array of boolean\u003C\u002Fcode> indexed by the ID instead, and count its \u003Ccode>TRUE\u003C\u002Fcode> entries with the same kind of loop. If your members are characters, \u003Ccode>set of char\u003C\u002Fcode> works, and you test the character itself with \u003Ccode>in\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"break-it-on-purpose\">Break it on purpose\u003C\u002Fh2>\n\u003Cp>Add student 4 to \u003Ccode>absentA\u003C\u002Fcode> with \u003Ccode>absentA := [1, 2, 3, 4];\u003C\u002Fcode> and the checker fails line 1, because the count is now 4. Then put \u003Ccode>if absentA &gt;= absentB then\u003C\u002Fcode> back, and line 3 goes red again.\u003C\u002Fp>\n\u003Cp>Use a set when the question is whether a value is in a group, and compare sets with \u003Ccode>&gt;=\u003C\u002Fcode> only when you mean &quot;contains all of&quot;. When the question is how many, loop, count, and compare the counts.\u003C\u002Fp>\n","\u003Cul>\n\u003Cli>A \u003Ccode>SET OF\u003C\u002Fcode> answers membership, not order and not size: \u003Ccode>&gt;=\u003C\u002Fcode> asks whether one set contains every element of the other.\u003C\u002Fli>\n\u003Cli>Free Pascal refuses \u003Ccode>&gt;\u003C\u002Fcode> and \u003Ccode>&lt;\u003C\u002Fcode> on sets with \u003Ccode>Error: Operation not implemented for sets\u003C\u002Fcode>, so the wrong question usually reaches the compiler as \u003Ccode>&gt;=\u003C\u002Fcode> and compiles.\u003C\u002Fli>\n\u003Cli>Counting the entries in a set takes a loop over its base type; Pascal gives a set no \u003Ccode>Length\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>A set is a 4-byte mask up to 32 elements and 32 bytes above that, whatever range you declared.\u003C\u002Fli>\n\u003Cli>The base type has to be an ordinal in 0..255, so student IDs above 255 belong in an array, not a set.\u003C\u002Fli>\n\u003C\u002Ful>\n",[218,236,254,270,287,307],{"id":219,"title":220,"title_id":221,"slug":222,"excerpt":223,"excerpt_id":224,"has_translation":12,"published_at":225,"reading_time":179,"hidden_from_listing":15,"tags":226,"thumbnail_image":21,"og_image":230,"series":231,"authors":233},164,"Python Capstone: Why a Blank CSV Field Cut the Class Average","Python Capstone: Kenapa Satu Kolom CSV Kosong Memotong Rata-rata Kelas","python-capstone-gradebook","A gradebook reads four students and writes a JSON report. The class average says 52.42, because two empty fields became zeros.","Buku nilai membaca empat siswa dan menulis laporan JSON. Rata-rata kelasnya bilang 52.42, karena dua kolom kosong berubah jadi nol.","2026-11-21T01:00:00.000Z",[227,228,229],"python","input-output","cli","\u002Fog\u002Fpython-capstone-gradebook.png",{"id":232,"title":55,"title_id":56,"slug":57},10,[234],{"authors_id":235},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":237,"title":238,"title_id":239,"slug":240,"excerpt":241,"excerpt_id":242,"has_translation":12,"published_at":225,"reading_time":142,"hidden_from_listing":15,"tags":243,"thumbnail_image":21,"og_image":245,"series":246,"authors":251},48,"What a Linked List Actually Is","Tentang Struktur Data LinkedList","tentang-struktur-data-linked-list","A linked list is a linear chain of nodes, each holding data and a pointer to the next node. Here is what that chain looks like, what it costs next to an array, and the same minimal implementation in Java, Python, and JavaScript.","Linked list adalah rantai linear berisi node, dan setiap node menyimpan data plus pointer ke node berikutnya. Ini bentuk rantainya, ongkosnya dibanding array, dan implementasi paling sederhana dalam Java, Python, serta JavaScript.",[88,244,160,109],"linked-list","\u002Fog\u002Ftentang-struktur-data-linked-list.png",{"id":247,"title":248,"title_id":249,"slug":250},28,"Linear Data Structures","Struktur Data Linear","asd-struktur-linear",[252],{"authors_id":253},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":255,"title":256,"title_id":257,"slug":258,"excerpt":259,"excerpt_id":260,"has_translation":12,"published_at":261,"reading_time":262,"hidden_from_listing":15,"tags":263,"thumbnail_image":21,"og_image":265,"series":266,"authors":267},163,"Pascal Capstone: Why Every Gradebook Score Came Back Zero","Capstone Pascal: Kenapa Semua Skor Buku Nilai Kembali Nol","pascal-gradebook-capstone","A gradebook reads three students from a file, prints three rows, and every score is 0. The procedure filled a copy of the array, because the parameter was missing `var`. Add the word and the report matches the file; the compiler had already warned about the call that filled nothing.","Sebuah buku nilai membaca tiga siswa dari berkas, mencetak tiga baris, dan setiap skornya 0. Prosedurnya mengisi salinan array, karena parameternya kehilangan `var`. Tambahkan kata itu dan laporannya cocok dengan berkasnya; kompilator sudah memperingatkan soal pemanggilan yang tidak mengisi apa pun.","2026-11-20T01:00:00.000Z",6,[86,128,144,264],"prosedur","\u002Fog\u002Fpascal-gradebook-capstone.png",{"id":188,"title":67,"title_id":68,"slug":69},[268],{"authors_id":269},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":271,"title":272,"title_id":273,"slug":274,"excerpt":275,"excerpt_id":276,"has_translation":12,"published_at":261,"reading_time":262,"hidden_from_listing":15,"tags":277,"thumbnail_image":21,"og_image":278,"series":279,"authors":284},162,"Python File I\u002FO: Why the Second Read Came Back Empty","Python File I\u002FO: Kenapa Pembacaan Kedua Kembali Kosong","python-file-read-write","A notes script saves a line, prints it back, then counts zero. The file on disk is correct: `read()` left the pointer at the end, so the second call returned an empty string. Read once into a variable, or `seek(0)`, and the count matches the file.","Skrip catatan menyimpan satu baris, mencetaknya kembali, lalu menghitung nol. Berkas di disk sudah benar: `read()` meninggalkan pointer di ujung, jadi panggilan kedua mengembalikan string kosong. Baca sekali ke sebuah variabel, atau `seek(0)`, dan hitungannya cocok dengan berkas.",[227,228],"\u002Fog\u002Fpython-file-read-write.png",{"id":280,"title":281,"title_id":282,"slug":283},18,"Working with Python Scripts","Menggunakan Script Python","python-pemrograman-dengan-script",[285],{"authors_id":286},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":288,"title":289,"title_id":290,"slug":291,"excerpt":292,"excerpt_id":293,"has_translation":12,"published_at":294,"reading_time":84,"hidden_from_listing":15,"tags":295,"thumbnail_image":21,"og_image":298,"series":299,"authors":304},47,"Why Understanding Algorithms and Data Structures Actually Matters","Pentingnya Memahami Algoritma dan Struktur Data","pentingnya-memahami-algoritma-dan-struktur-data","An algorithm is an ordered list of steps, and that order decides how expensive a problem is. The examples are on the back of an instant noodle packet, in a factorial, and behind ctrl+z.","Sebagai konsep fundamental, algoritma menentukan seberapa mahal sebuah masalah diselesaikan. Contohnya ada di bungkus mie instan, di bilangan faktorial, dan di tombol undo.","2026-11-19T01:00:00.000Z",[296,88,109,297],"algoritma","dasar","\u002Fog\u002Fpentingnya-memahami-algoritma-dan-struktur-data.png",{"id":300,"title":301,"title_id":302,"slug":303},27,"About Algorithms and Data Structures","Tentang Algoritma dan Struktur Data","asd-intro",[305],{"authors_id":306},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},{"id":308,"title":309,"title_id":310,"slug":311,"excerpt":312,"excerpt_id":313,"has_translation":12,"published_at":314,"reading_time":84,"hidden_from_listing":15,"tags":315,"thumbnail_image":21,"og_image":317,"series":318,"authors":319},161,"Debugging Free Pascal with -gl and gdb","Men-debug Free Pascal dengan -gl dan gdb","pascal-debugging-fpc-gdb","A run with no prices ends at a hex address and status 217. `-gl` names the line, gdb names the values, and the mean of six positive prices comes out negative because `integer` is 2 bytes.","Jalan tanpa satu harga pun berakhir di alamat hex dan status 217. `-gl` menyebut barisnya, gdb menyebut nilainya, dan rata-rata dari enam harga positif keluar negatif karena `integer` berukuran 2 byte.","2026-11-18T01:00:00.000Z",[86,316],"debugging","\u002Fog\u002Fpascal-debugging-fpc-gdb.png",{"id":188,"title":67,"title_id":68,"slug":69},[320],{"authors_id":321},{"id":115,"name":116,"slug":117,"role":118,"profile_picture":21},[323,326,329,332,335,338],{"text":324,"depth":158,"id":325},"What a set keeps and what it drops","what-a-set-keeps-and-what-it-drops",{"text":327,"depth":158,"id":328},"Adding, removing, testing","adding-removing-testing",{"text":330,"depth":158,"id":331},"The comparison that is not a count","the-comparison-that-is-not-a-count",{"text":333,"depth":158,"id":334},"Two files, one command","two-files-one-command",{"text":336,"depth":158,"id":337},"Where sets stop","where-sets-stop",{"text":339,"depth":158,"id":340},"Break it on purpose","break-it-on-purpose",1795825296617]