//honeypot demagogic

 Forum DhammaCitta. Forum Diskusi Buddhis Indonesia

Author Topic: mohon petunjuk untuk membaca file *.MAZ  (Read 3787 times)

0 Members and 1 Guest are viewing this topic.

Offline Lex Chan

  • Global Moderator
  • KalyanaMitta
  • *****
  • Posts: 3.437
  • Reputasi: 134
  • Gender: Male
  • Love everybody, not every body...
mohon petunjuk untuk membaca file *.MAZ
« on: 07 February 2009, 06:34:12 PM »
help..

aye perlu bantuan untuk membaca file *.MAZ ke dalam bahasa pemrograman.

file itu dibuka biar bisa dibaca dalam format HEXADECIMAL seperti memakai program hex editor (misalnya file zigzag.maz):


FYI, file *.MAZ ini besarnya sudah fixed 256 byte.

untuk sementara aye pakai metode membaca isi file tersebut dengan format ASCII, lalu diubah ke dalam HEXADECIMAL. tapi masalahnya kalo dibaca dengan ASCII, jumlah karakter yang terbaca tidak selalu 256 (1 karakter ASCII = 1 byte). kebanyakan kurang dari 256 karakter karena ada karakter yg tidak bisa terbaca sebagai ASCII..

ada metode lain?

download sample file2 *.MAZ di sini:
http://www.mediafire.com/file/5y2wvyw3ytx/MAZs.zip
“Give the world the best you have and you may get hurt. Give the world your best anyway”
-Mother Teresa-

Offline Sumedho

  • Kebetulan
  • Administrator
  • KalyanaMitta
  • *****
  • Posts: 12.406
  • Reputasi: 423
  • Gender: Male
  • not self
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #1 on: 07 February 2009, 06:46:17 PM »
pake bahasa apaan oom?
There is no place like 127.0.0.1

Offline hatRed

  • KalyanaMitta
  • *****
  • Posts: 7.400
  • Reputasi: 138
  • step at the right place to be light
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #2 on: 07 February 2009, 07:11:56 PM »
pake Vim  :>-
i'm just a mammal with troubled soul



Offline Lex Chan

  • Global Moderator
  • KalyanaMitta
  • *****
  • Posts: 3.437
  • Reputasi: 134
  • Gender: Male
  • Love everybody, not every body...
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #3 on: 07 February 2009, 07:15:49 PM »
pake bahasa apaan oom?

aye sih pake Borland Delphi..

harusnya sih bahasa ngga terlalu ngaruh, yg penting teknik ngebacanya.. 8)
“Give the world the best you have and you may get hurt. Give the world your best anyway”
-Mother Teresa-

Offline hatRed

  • KalyanaMitta
  • *****
  • Posts: 7.400
  • Reputasi: 138
  • step at the right place to be light
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #4 on: 07 February 2009, 07:16:34 PM »
tapi ini maksudnya gmana ya?

itu di gambar dah bisa dibuka..kok malah pake notepad lagi?
i'm just a mammal with troubled soul



Offline hatRed

  • KalyanaMitta
  • *****
  • Posts: 7.400
  • Reputasi: 138
  • step at the right place to be light
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #5 on: 07 February 2009, 07:17:30 PM »
oooooooo... mo tau cara baca hexademal ya?
i'm just a mammal with troubled soul



Offline Lex Chan

  • Global Moderator
  • KalyanaMitta
  • *****
  • Posts: 3.437
  • Reputasi: 134
  • Gender: Male
  • Love everybody, not every body...
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #6 on: 07 February 2009, 08:57:02 PM »
tapi ini maksudnya gmana ya?

itu di gambar dah bisa dibuka..kok malah pake notepad lagi?

maksudnya, mau buka file itu sehingga bisa menampilkan nilai HEXADECIMAL-nya..

tapi ngebukanya bukan pake program hex editor, melainkan pake bahasa pemrograman, biar nanti datanya bisa diolah lagi..
“Give the world the best you have and you may get hurt. Give the world your best anyway”
-Mother Teresa-

Offline Lex Chan

  • Global Moderator
  • KalyanaMitta
  • *****
  • Posts: 3.437
  • Reputasi: 134
  • Gender: Male
  • Love everybody, not every body...
Re: mohon petunjuk untuk membaca file *.MAZ
« Reply #7 on: 07 February 2009, 10:02:02 PM »
ternyata kesalahan ada di programming aye
baca pakai ASCII tidak ada masalah, asalkan jangan pake Eof..

sebelum:
Code: [Select]
    while not Eof(F) do
    begin
      while not Eoln(F) do
      begin
        Read(F, letter);
        mazedata[i]:=IntToBin(AsciiToInt(letter));
        i:=i+1;
      end;
      ReadLn(F, text);
    end;

sesudah:
Code: [Select]
    for i:=0 to 255 do
    begin
      Read(F, letter);
      mazedata[i]:=IntToHex(AsciiToInt(letter));
    end;

berhubung uda bisa.. jadi case is closed.. 8)
“Give the world the best you have and you may get hurt. Give the world your best anyway”
-Mother Teresa-