Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.
|
|
| [ASK] Soal algoritma . . . . | |
| 2012-04-06, 14:59 | [ASK] Soal algoritma . . . . |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| To the point.... okay? - initialize:
oooooooooo oooooooooo oooooooooo ooooxooooo oooooooooo oooooooooo oooooooooo
diketahui : - Anda menggunakan pascal....
- koordinat x = [a,b]
- s = 3
Hasilnya pengen . . . . - straight:
ooooxooooo ooooxooooo ooooxooooo oxxxxxxxoo ooooxooooo ooooxooooo ooooxooooo
- diamond:
ooooxooooo oooxxxoooo ooxxxxxooo oxxxxxxxoo ooxxxxxooo oooxxxoooo ooooxooooo
- square:
oxxxxxxxoo oxxxxxxxoo oxxxxxxxoo oxxxxxxxoo oxxxxxxxoo oxxxxxxxoo oxxxxxxxoo
- diagonal:
oxoooooxoo ooxoooxooo oooxoxoooo ooooxooooo oooxoxoooo ooxoooxooo oxoooooxoo
Dan 1 lagi, circle.... The algorithm please? q lgi males2 ny mikir.... |
| | | 2012-04-06, 15:03 | Re: [ASK] Soal algoritma . . . . |
---|
Aegis Legendary
Posts : 2152 Thanked : 56 Engine : Multi-Engine User Skill : Very Beginner Type : Artist
Awards:
| wah ini pasti buat tugas yah ? saya ga mau tertipu |
| | | 2012-04-06, 15:03 | Re: [ASK] Soal algoritma . . . . |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| Jadi... Apa maksudnya ya? |
| | | 2012-04-06, 18:08 | Re: [ASK] Soal algoritma . . . . |
---|
Mecha Byte Newbie
Posts : 36 Thanked : 0 Engine : RMXP Skill : Beginner Type : Scripter
| Apa tipe struktur data yang ingin digunakan? Aku bantu kasih clue aja ya . Aku pakai bahasa C campur pseucode biar tidak panjang-panjang nulis keywordnya
Nih clue 1:
- Code:
-
bool Map[9][7];
Catatan: belum kutes, tapi harusnya sudah lumayan akurat
baru: yang prosedur tadi tidak jadi . tapi petunjuk pertama cukup pakai array 2 dimensio
wah lama banget responnya
ya udah, kukasih clue 2
- Code:
-
void Straight(int x, int y, int s) { for (int i=0; i < s; s++) { Map(x,y-i-1) = true Map(x,y+i+1) = true Map(x-i-1,y) = true Map(x+i+1,y) = true }
}
void Diamond(int x, int y, int s) {
int YStart = y-s
for (int i=0; i < s; s++) { Map(x,YStart +i) = true for (int j=0;j<i;j++) { Map(x,YStart +i) = true Map(x,YStart +i) = true } }
YStart = y+s
for (int i=0; i < s; s++) { Map(x,YStart -i) = true for (int j=0;j<i;j++) { Map(x-j,YStart -i) = true Map(x+j,YStart -i) = true } }
}
void Square(int x, int y, int s) { int XStart = x-s int YStart = y-s
for (int i=0; i < s*2+1; s++) { for (int j=0; j < s*2+1; j++) { Map(XStart +j,YStart +i) = true } }
void Diagonal(int x, int y, int s) {
for (int i=0; i < s; s++) { Map[x-1-i,y-1-i] = true; Map[x+1+i,y+1+i] = true; Map[x-1-i,y+1+i] = true; Map[x+1+i,y-1-i] = true; }
}
Atur sendiri konstrainnya Perlu algoritma draw mapnya? Tidak kan? Soalnya itu mudah banget Dan... belum dites, tapi akurasinya cukup untuk menyelesaikan permasalahan tadi
|
| | | 2012-04-06, 19:49 | Re: [ASK] Soal algoritma . . . . |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| thanx then.... q cuma lgi males2ny mikir panjang ~ lgian q cuma butuh "logika" biar dapet koordinatny doank ~ maybe a little fix? atau sdikit kompres? - Code:
-
void Straight(int x, int y, int s) { for (i=s*-1; i <= s; i++) { Map(x,y+i) = true Map(x+i,y) = true }
- Code:
-
void Square(int x, int y, int s) { for (i=s*-1; i <= s; i++) { Map(x,y+i) = true for (j=s*-1; j <= s; j++) { Map(x+j,y) = true } }
- Code:
-
void Diagonal(int x, int y, int s) { for (int i=s*-1; i < s; i++) { Map(x+i,y+i) = true Map(x-i,y-i) = true }
Well.... Tinggal soal Diamond (msih ragu) ama Circle . . . . BTW sebisa mungkin line ny jangan panjang2 . . . . |
| | | 2012-04-06, 19:58 | Re: [ASK] Soal algoritma . . . . |
---|
Mecha Byte Newbie
Posts : 36 Thanked : 0 Engine : RMXP Skill : Beginner Type : Scripter
| Akhirnya datang Yang diamond
- Code:
-
void Diamond(int x, int y, int s) {
// Membuat segitiga atas int YStart = y-s
for (int i=0; i < s; s++) { Map(x,YStart +i) = true for (int j=0;j<i;j++) { Map(x,YStart +i) = true Map(x,YStart +i) = true } }
// Membuat segitiga bawah YStart = y+s
for (int i=0; i < s; s++) { Map(x,YStart -i) = true for (int j=0;j<i;j++) { Map(x-j,YStart -i) = true Map(x+j,YStart -i) = true } }
}
Udah ditambahin komen biar lebih jelas . Soal Circle, bisa beri contohnya yang bagaimana? Soalnya ada yang 4 sudut, 8 sudut.
|
| | | 2012-04-06, 20:51 | Re: [ASK] Soal algoritma . . . . |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| *sigh* aq yakin banget, klo ada langkah yg lbih pendek daripada demikian wait.... - Code:
-
void Diamond(int x, int y, int s){ t == 0; for (i=s*-1; i <= s; s++) { Map(x,y+i) = true if (i >= 0){ t--; } else{ t++; } for (j=0; j < t; j++) { Map(x+j,y) = true Map(x-j,y) = true } }
Is this acceptable? Kyakny q cuma mampu tergerak untuk ngedit milik orang.... About circle.... Seperti halny mmbuat lingkaran.... tentunya trigonometri wajib masuk (sin? cos? tan?) |
| | | 2012-04-06, 21:25 | Re: [ASK] Soal algoritma . . . . |
---|
Mecha Byte Newbie
Posts : 36 Thanked : 0 Engine : RMXP Skill : Beginner Type : Scripter
| | | | 2012-04-07, 05:15 | Re: [ASK] Soal algoritma . . . . |
---|
eve Loli Mecha Mesum Musume
Posts : 1620 Thanked : 30 Engine : Other Skill : Beginner Type : Writer
Awards:
| lingkaran? - Code:
-
begin writeln('ooooxxoooo'); writeln('ooxxooxxoo'); writeln('xoooooooox'); writeln('xoooooooox'); writeln('ooxxooxxoo'); writeln('ooooxxoooo'); end. gitu aja kok repot... *kabur yang jauh |
| | | 2012-04-12, 20:31 | Re: [ASK] Soal algoritma . . . . |
---|
Kuro Ethernite The Creator
Posts : 1631 Thanked : 24 Engine : RMVX Ace Skill : Masterful Type : Jack of All Trades
Awards:
| WTF ?! oke . . . . Porget about teh circle . . . . Diketahui . . . . - initialize:
ooooooooooooo ooaoooooooooo ooooooooooooo ooooooooooaoo ooooooxoooooo ooooooooooooo oooaooooooooo ooooooooooooo oooooooooooao
- process:
ooooooooooooo ooxoooooooooo oooxooooooooo ooooxxooxxxoo ooooooxxooooo ooooxxoxooooo oooxooooxxooo ooooooooooxoo oooooooooooxo
- hasil:
ooooooooooooo ooxoooooooooo ooooooooooooo ooooooooooxoo ooooooooooooo ooooooooooooo oooxooooooooo ooooooooooooo oooooooooooxo a = berupa array yang berisi informasi nilai [x,y]Intinya, x bergerak lurus / linear menuju tiap a yang ada secara bersamaan ~ |
| | | | Re: [ASK] Soal algoritma . . . . |
---|
Sponsored content
| | | | | [ASK] Soal algoritma . . . . | |
|
Similar topics | |
|
Similar topics | |
| |
Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|