News:

Semoga anda berbahagia _/\_

Main Menu

mohon petunjuk untuk membaca file *.MAZ

Started by Lex Chan, 07 February 2009, 06:34:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lex Chan

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-

Sumedho

There is no place like 127.0.0.1

hatRed

i'm just a mammal with troubled soul



Lex Chan

Quote from: Sumedho on 07 February 2009, 06:46:17 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-

hatRed

tapi ini maksudnya gmana ya?

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



hatRed

oooooooo... mo tau cara baca hexademal ya?
i'm just a mammal with troubled soul



Lex Chan

Quote from: hatRed on 07 February 2009, 07:16:34 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-

Lex Chan

ternyata kesalahan ada di programming aye
baca pakai ASCII tidak ada masalah, asalkan jangan pake Eof..

sebelum:
    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:
    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-