Upload files to "/"

This commit is contained in:
2026-03-12 04:15:07 +00:00
parent 48f0cc6653
commit af908f2253
3 changed files with 205 additions and 0 deletions

90
MG5_n1.fprg Normal file
View File

@@ -0,0 +1,90 @@
<?xml version="1.0"?>
<flowgorithm fileversion="4.2">
<attributes>
<attribute name="name" value="GuessThePrice"/>
<attribute name="authors" value="yvl"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2026-03-12 10:14:20 AM"/>
<attribute name="created" value="eXZsO1lVVkxJQU5fV0FTX0hFUkU7MjAyNi0wMy0xMjswODozMjoyMyBBTTsxMTEx"/>
<attribute name="edited" value="eXZsO1lVVkxJQU5fV0FTX0hFUkU7MjAyNi0wMy0xMjswODozMjoyMyBBTTsxOzExMTE="/>
<attribute name="edited" value="eXV2bGlhbjtDT1NNT1M7MjAyNi0wMy0xMjsxMDoxNDoyMCBBTTsxOzI2MDU="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="targetHarga, angkaTebakan, percobaan, diff" type="Integer" array="False" size=""/>
<declare name="diffPersen" type="Real" array="False" size=""/>
<declare name="inputTebakan, ket" type="String" array="False" size=""/>
<declare name="jawabanBenar" type="Boolean" array="False" size=""/>
<assign variable="targetHarga" expression="0"/>
<while expression="targetHarga &lt; 10000">
<assign variable="targetHarga" expression="Random(200001)"/>
</while>
<output expression="&quot;DEBUG: targetHarga = &quot; &amp; targetHarga" newline="True"/>
<assign variable="percobaan" expression="0"/>
<assign variable="jawabanBenar" expression="false"/>
<output expression="&quot;Tebak harga barang (Rp 10.000 - Rp 200.000).&quot;" newline="True"/>
<output expression="&quot;Ketik nyerah untuk berhenti.&quot;" newline="True"/>
<while expression="not jawabanBenar and percobaan &lt; 12">
<output expression="&quot;Tebakan &quot; &amp; (percobaan + 1) &amp; &quot;/12&quot;" newline="True"/>
<output expression="&quot;Masukkan tebakan anda:&quot;" newline="True"/>
<input variable="inputTebakan"/>
<if expression="inputTebakan = &quot;nyerah&quot;">
<then>
<output expression="&quot;Jawaban yang benar: Rp &quot; &amp; targetHarga" newline="True"/>
<assign variable="percobaan" expression="12"/>
</then>
<else>
<assign variable="angkaTebakan" expression="ToInteger(inputTebakan)"/>
<if expression="angkaTebakan &lt; 10000 or angkaTebakan &gt; 200000">
<then>
<output expression="&quot;Input tidak valid! Masukkan angka antara 10000 sampai 200000.&quot;" newline="True"/>
</then>
<else>
<assign variable="percobaan" expression="percobaan + 1"/>
<if expression="angkaTebakan = targetHarga">
<then>
<output expression="&quot;Selamat! Tebakan Anda benar!&quot;" newline="True"/>
<assign variable="jawabanBenar" expression="true"/>
</then>
<else>
<assign variable="diffPersen" expression="((angkaTebakan - targetHarga) * 100.0) / targetHarga"/>
<if expression="diffPersen &gt; 0">
<then>
<assign variable="ket" expression="&quot;kelebihan &quot; &amp; diffPersen"/>
</then>
<else>
<assign variable="ket" expression="&quot;kekurangan &quot; &amp; Abs(diffPersen)"/>
</else>
</if>
<if expression="Abs(diffPersen) &lt;= 5">
<then>
<output expression="&quot;PANAS! (Jawabanmu &quot; &amp; ket &amp; &quot;%)&quot;" newline="True"/>
</then>
<else>
<if expression="Abs(diffPersen) &lt;= 15">
<then>
<output expression="&quot;HANGAT! (Jawabanmu &quot; &amp; ket &amp; &quot;%)&quot;" newline="True"/>
</then>
<else>
<output expression="&quot;DINGIN! (Jawabanmu &quot; &amp; ket &amp; &quot;%)&quot;" newline="True"/>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</else>
</if>
</while>
<if expression="not jawabanBenar and percobaan = 12 and inputTebakan != &quot;nyerah&quot;">
<then>
<output expression="&quot;Kesempatan habis! Jawaban yang benar: &quot; &amp; targetHarga" newline="True"/>
</then>
<else/>
</if>
</body>
</function>
</flowgorithm>

2
MG5_n2.fprg Normal file

File diff suppressed because one or more lines are too long

113
MG5_n3.fprg Normal file
View File

@@ -0,0 +1,113 @@
<?xml version="1.0"?>
<flowgorithm fileversion="4.2">
<attributes>
<attribute name="name" value="KuisInteraktif"/>
<attribute name="authors" value="yvl"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2026-03-12 10:06:21 AM"/>
<attribute name="created" value="eXZsO1lVVkxJQU5fV0FTX0hFUkU7MjAyNi0wMy0xMjsxMDowMTowNCBBTTsxMTEx"/>
<attribute name="edited" value="eXZsO1lVVkxJQU5fV0FTX0hFUkU7MjAyNi0wMy0xMjsxMDowMTowNCBBTTsxOzExMTE="/>
<attribute name="edited" value="eXV2bGlhbjtDT1NNT1M7MjAyNi0wMy0xMjsxMDowNjoyMSBBTTsyOzI2MDg="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="score, salahBeruntun, soalDijawab, pilihan, inputCode" type="Integer" array="False" size=""/>
<declare name="jawaban" type="String" array="False" size=""/>
<declare name="inputValid" type="Boolean" array="False" size=""/>
<declare name="daftarSoal" type="String" array="True" size="5"/>
<declare name="daftarPilihan" type="String" array="True" size="5"/>
<declare name="kodeJawaban" type="Integer" array="True" size="5"/>
<call expression="setSoal(daftarSoal, daftarPilihan, kodeJawaban, 0, &quot;Soal 1: Ibukota Indonesia adalah?&quot;, &quot;a. Jakarta b. Surabaya c. Bandung d. Medan&quot;, ToCode(&quot;a&quot;))"/>
<call expression="setSoal(daftarSoal, daftarPilihan, kodeJawaban, 1, &quot;Soal 2: 2 + 2 = ?&quot;, &quot;a. 3 b. 4 c. 5 d. 6&quot;, ToCode(&quot;b&quot;))"/>
<call expression="setSoal(daftarSoal, daftarPilihan, kodeJawaban, 2, &quot;Soal 3: Warna langit?&quot;, &quot;a. Hijau b. Biru c. Merah d. Kuning&quot;, ToCode(&quot;b&quot;))"/>
<call expression="setSoal(daftarSoal, daftarPilihan, kodeJawaban, 3, &quot;Soal 4: Hewan berkaki empat?&quot;, &quot;a. Ayam b. Ikan c. Kucing d. Burung&quot;, ToCode(&quot;c&quot;))"/>
<call expression="setSoal(daftarSoal, daftarPilihan, kodeJawaban, 4, &quot;Soal 5: 5 x 5 = ?&quot;, &quot;a. 20 b. 25 c. 30 d. 35&quot;, ToCode(&quot;b&quot;))"/>
<assign variable="score" expression="0"/>
<assign variable="salahBeruntun" expression="0"/>
<assign variable="soalDijawab" expression="0"/>
<assign variable="pilihan" expression="0"/>
<output expression="&quot;Selamat datang di Kuis Interaktif!&quot;" newline="True"/>
<while expression="pilihan != 3">
<output expression="&quot;Menu:&quot;" newline="True"/>
<output expression="&quot;1. Jawab Soal Berikutnya&quot;" newline="True"/>
<output expression="&quot;2. Lihat Skor&quot;" newline="True"/>
<output expression="&quot;3. Keluar&quot;" newline="True"/>
<output expression="&quot;Pilihan: &quot;" newline="False"/>
<input variable="pilihan"/>
<if expression="pilihan == 1">
<then>
<output expression="daftarSoal[soalDijawab]" newline="True"/>
<output expression="daftarPilihan[soalDijawab]" newline="True"/>
<assign variable="inputValid" expression="false"/>
<while expression="not inputValid">
<output expression="&quot;Jawaban (a/b/c/d): &quot;" newline="False"/>
<input variable="jawaban"/>
<if expression="Len(jawaban) &gt; 0">
<then>
<assign variable="inputValid" expression="jawaban == &quot;a&quot; or jawaban == &quot;b&quot; or jawaban == &quot;c&quot; or jawaban == &quot;d&quot;"/>
</then>
<else>
<output expression="&quot;Input tidak boleh kosong!&quot;" newline="True"/>
</else>
</if>
</while>
<assign variable="inputCode" expression="ToCode(Char(jawaban, 0))"/>
<if expression="inputCode == kodeJawaban[soalDijawab]">
<then>
<assign variable="score" expression="score + 20"/>
<assign variable="salahBeruntun" expression="0"/>
<output expression="&quot;Benar! Skor Anda: &quot; &amp; score" newline="True"/>
</then>
<else>
<assign variable="salahBeruntun" expression="salahBeruntun + 1"/>
<output expression="&quot;Salah! (Salah beruntun: &quot; &amp; salahBeruntun &amp; &quot;)&quot;" newline="True"/>
</else>
</if>
<assign variable="soalDijawab" expression="soalDijawab + 1"/>
<if expression="salahBeruntun == 3">
<then>
<output expression="&quot;Anda telah salah 3 kali berturut-turut. Kuis berhenti.&quot;" newline="True"/>
<assign variable="pilihan" expression="3"/>
</then>
<else>
<if expression="soalDijawab == 5">
<then>
<output expression="&quot;Semua soal telah dijawab.&quot;" newline="True"/>
<assign variable="pilihan" expression="3"/>
</then>
<else/>
</if>
</else>
</if>
</then>
<else>
<if expression="pilihan == 2">
<then>
<output expression="&quot;Skor saat ini: &quot; &amp; score" newline="True"/>
</then>
<else/>
</if>
</else>
</if>
</while>
<output expression="&quot;Skor akhir Anda: &quot; &amp; score" newline="True"/>
</body>
</function>
<function name="setSoal" type="None" variable="">
<parameters>
<parameter name="sArr" type="String" array="True"/>
<parameter name="pArr" type="String" array="True"/>
<parameter name="jArr" type="Integer" array="True"/>
<parameter name="idx" type="Integer" array="False"/>
<parameter name="tSoal" type="String" array="False"/>
<parameter name="tPilihan" type="String" array="False"/>
<parameter name="nJawaban" type="Integer" array="False"/>
</parameters>
<body>
<assign variable="sArr[idx]" expression="tSoal"/>
<assign variable="pArr[idx]" expression="tPilihan"/>
<assign variable="jArr[idx]" expression="nJawaban"/>
</body>
</function>
</flowgorithm>