From: io_x on

"Benjamin David Lunt" <zfysz(a)frontiernet.net> ha scritto nel messaggio
news:BE9tm.61150$u76.60254(a)newsfe10.iad...
> Hi everyone,
>
> We have started a new competition at
> http://www.frontiernet.net/~fys/hugi/hcompo.htm
>
> The task is to create a random solution text based maze
> similar to:
>
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
> | | | | | | | |
> +--+ +--+--+--+--+--+--+ + + + +--+--+ +
> | | | | | |
> + +--+ +--+--+--+--+ + +--+--+--+ + +--+
> | | | | | | | |
> + +--+ + + +--+ +--+ +--+ +--+--+--+ +
> | | | | | |
> + +--+ + +--+--+--+--+ + +--+--+ +--+ +
> | | | |
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
>
> Your task is to display a maze using a given
> RNG algo so that your entry displays the same
> maze as the tester does, in the least amount
> of bytes as possible.
>
> In other words, the smallest entry.com file is the
> winner.
>
> The algo description is at
> http://en.wikipedia.org/wiki/Maze_generation_algorithm
>
> There is an example program included with the rules.
>
> A discussion board has just been created at
> http://temet.es/hcompo/forum/
>
> If you would like to participate, please do.
>
> Thanks,
> Ben
>

if i understand well
this is my try (195 byte)

; m2m m.m m.asm
;com file
;nasmw -o m.com m.asm

org 100h
Start:
push bx
push si
push di
push bp
; in si la stringa
sub sp, 128
mov ah, 0
int 01ah
mov [seed], dx
mov di, sp
mov si, sp ; line in the stack
mov word[di+46], 0A0Dh
mov byte[di+48], 0 ; here 0D_0A_00 line
xor bp, bp
mov dx, -1
jmp short .2
..1: call rand
mov dx, ax
call WriteLine1
call rand
mov dx, ax
cmp bp, 5
jne .2
mov dx, -1
..2: call WriteLine
inc bp
cmp bp, 5
jbe .1
add sp, 128
pop bp
pop di
pop si
pop bx
ret

rand:
mov dx, 30721
mov ax, [seed]
mul dx
add ax, 13971
and ax, 0FFFCh
and dx, 3 ; passo gli ultimi 2 bits di r in a
or ax, dx
mov [seed], ax
ret

outputLine:
mov di, si
mov ah, 0Eh
..1: mov al, [di]
cmp al, 0
je .z
inc di
int 10h
jmp short .1
..z:
ret

; in dx ci sono i 16 bit
; che rappresentano 16 pezzi
; di muro (1==c'�, 0==non c'�)
WriteLine:
mov cx, 15
mov di, si
..1: mov byte[di], '+'
jcxz .3
mov word[di+1], "--"
test dx, 1
jnz .2
mov word[di+1], " "
..2: dec cx
add di, 3
shr dx, 1
jmp short .1
..3: call outputLine
..z:
ret

; in dx ci sono i 16 bit
; che rappresentano 16 pezzi
; di muro (1==c'�, 0==non c'�)
WriteLine1:
mov cx, 15
mov di, si
..1: mov byte[di], '|'
test dx, 1
jnz .2
mov byte[di], ' '
..2: jcxz .3
mov word[di+1], " "
dec cx
shr dx, 1
add di, 3
jmp short .1
..3: call outputLine
..z:
ret
seed dw 12921
---------------------
; m2m m.m m.asm
;com file
;nasmw -o m.com m.asm

org 100h
Start:
<b,i,j,k
; in si la stringa
s-=128
ah=0|int 01ah|*seed=r
j=s|i=s ; line in the stack
W*j+46=0A0Dh|B*j+48=0 ; here 0D_0A_00 line
k^=k|r=-1|#.2
..1: r=rand()|WriteLine1()
r=rand()
k==5!#.2|r=-1
..2: WriteLine()
++k
k<=5#.1
s+=128
>b,i,j,k
ret

rand:
r =30721 |a =*seed|mul r
a+=13971
a&=0FFFCh|r&=3 ; passo gli ultimi 2 bits di r in a
a|=r
*seed=a
ret

outputLine:
j=i |ah=0Eh
..1: al=*j|al==0#.z|++j
int 10h|#.1
..z:
ret

; in dx ci sono i 16 bit
; che rappresentano 16 pezzi
; di muro (1==c'�, 0==non c'�)
WriteLine:
c=15|j=i
..1: B*j='+'|jcxz .3
W*j+1="--"
r & 1#.2 |W*j+1=" "
..2: --c |j+=3|r>>=1|#.1
..3: outputLine()
..z:
ret

; in dx ci sono i 16 bit
; che rappresentano 16 pezzi
; di muro (1==c'�, 0==non c'�)
WriteLine1:
c=15|j=i
..1: B*j='|'
r & 1#.2
B*j=' '
..2: jcxz .3
W*j+1=" "
--c |r>>=1|j+=3|#.1
..3: outputLine()
..z:
ret
seed dw 12921
------------------------------
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| | | | | | | | |
+ + + +--+ + + +--+ +--+--+--+--+--+--+
| | | | | | | |
+ + + +--+ +--+ +--+--+--+ +--+ +--+--+
| | | | | | | |
+ + +--+--+ + +--+--+ + + + + + +--+
| | | | | | | | | |
+ + + + +--+--+--+--+--+ +--+ +--+ +--+
| | | | |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+




From: Benjamin David Lunt on

"io_x" <a(a)b.c.invalid> wrote in message
news:4ab7d39a$0$832$4fafbaef(a)reader5.news.tin.it...
>
> "Benjamin David Lunt" <zfysz(a)frontiernet.net> ha scritto nel messaggio
> news:BE9tm.61150$u76.60254(a)newsfe10.iad...
>> Hi everyone,
>>
>> We have started a new competition at
>> http://www.frontiernet.net/~fys/hugi/hcompo.htm
>>
>> The task is to create a random solution text based maze
>> similar to:
>>
>> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
>> | | | | | | | |
>> +--+ +--+--+--+--+--+--+ + + + +--+--+ +
>> | | | | | |
>> + +--+ +--+--+--+--+ + +--+--+--+ + +--+
>> | | | | | | | |
>> + +--+ + + +--+ +--+ +--+ +--+--+--+ +
>> | | | | | |
>> + +--+ + +--+--+--+--+ + +--+--+ +--+ +
>> | | | |
>> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
>>
>> Your task is to display a maze using a given
>> RNG algo so that your entry displays the same
>> maze as the tester does, in the least amount
>> of bytes as possible.
>>
>> In other words, the smallest entry.com file is the
>> winner.
>>
>> The algo description is at
>> http://en.wikipedia.org/wiki/Maze_generation_algorithm
>>
>> There is an example program included with the rules.
>>
>> A discussion board has just been created at
>> http://temet.es/hcompo/forum/
>>
>> If you would like to participate, please do.
>>
>> Thanks,
>> Ben
>>
>
> if i understand well
> this is my try (195 byte)

Well, that's not fair. Suppose to send me the
..asm and .com files, not post it to the group. :-)

I think most of the people in the competition don't
visit this group, or at least I haven't seen their
names here.

Ben


From: io_x on
"Benjamin David Lunt" <zfysz(a)frontiernet.net> ha scritto nel messaggio
news:O9Rtm.60807$4t6.60741(a)newsfe06.iad...
>
> "io_x" <a(a)b.c.invalid> wrote in message
> news:4ab7d39a$0$832$4fafbaef(a)reader5.news.tin.it...
>>
>> "Benjamin David Lunt" <zfysz(a)frontiernet.net> ha scritto nel messaggio
>> news:BE9tm.61150$u76.60254(a)newsfe10.iad...
>>> Hi everyone,
>>>
>>> We have started a new competition at
>>> http://www.frontiernet.net/~fys/hugi/hcompo.htm

i forget to follow this above link
so not had clear the laws for the competition

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| | | | | | | |
+--+ +--+--+--+--+--+--+ + + + +--+--+ +
| | | | | |
+ +--+ +--+--+--+--+ + +--+--+--+ + +--+
| | | | | | | |
+ +--+ + + +--+ +--+ +--+ +--+--+--+ +
| | | | | |
+ +--+ + +--+--+--+--+ + +--+--+ +--+ +
| | | |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

************************************************

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| | | | | | | | |
+ + + +--+ + + +--+ +--+--+--+--+--+--+
| | | | | | | |
+ + + +--+ +--+ +--+--+--+ +--+ +--+--+
| | | | | | | |
+ + +--+--+ + +--+--+ + + + + + +--+
| | | | | | | | | |
+ + + + +--+--+--+--+--+ +--+ +--+ +--+
| | | | |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

this last above is without a different exit; is it a maze?



From: Rod Pemberton on
"Benjamin David Lunt" <zfysz(a)frontiernet.net> wrote in message
news:O9Rtm.60807$4t6.60741(a)newsfe06.iad...
>
> Well, that's not fair. Suppose to send me the
> .asm and .com files, not post it to the group. :-)
>

I don't have a submission. I may or may not. I didn't complete the other
one I tried. But since you were hosting this one, I was going to ask about
that. I don't have an email account available. And, I'd rather not set one
up...


Rod Pemberton


From: Benjamin David Lunt on

"io_x" <a(a)b.c.invalid> wrote in message
news:4ab894b8$0$1110$4fafbaef(a)reader1.news.tin.it...
> "Benjamin David Lunt" <zfysz(a)frontiernet.net> ha scritto nel messaggio
> news:O9Rtm.60807$4t6.60741(a)newsfe06.iad...
>>
>> We have started a new competition at
>> http://www.frontiernet.net/~fys/hugi/hcompo.htm
>
> i forget to follow this above link
> so not had clear the laws for the competition
>
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
> | | | | | | | | |
> + + + +--+ + + +--+ +--+--+--+--+--+--+
> | | | | | | | |
> + + + +--+ +--+ +--+--+--+ +--+ +--+--+
> | | | | | | | |
> + + +--+--+ + +--+--+ + + + + + +--+
> | | | | | | | | | |
> + + + + +--+--+--+--+--+ +--+ +--+ +--+
> | | | | |
> +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
>
> this last above is without a different exit; is it a maze?

Hi.

No, that would not be considered a valid maze and
would not pass the rules. The link above has an
example with it. Then to check to see if your
maze builder passes the rules, you simply file compare
(FC) your maze with the output of the example.

If they are the same, your maze builder passes.


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Holiday Game
Next: HLA v2.2 is now available