Re: Advent of Code 2018 megathread

2018-12-08 Thread Julien
Day 9 https://adventofcode.com/2018/day/9 was so much fun to solve ! I also really enjoyed day 3 https://adventofcode.com/2018/day/3 and day 6 https://adventofcode.com/2018/day/6 Do you guys have a favorite so far?

Re: Extract sprite data from old DOS game resource file?

2018-12-08 Thread treeform
Even if you get the sprites they might be all jumbled up like this: [http://www.gamasutra.com/db_area/images/news/253377/fig03.png](http://www.gamasutra.com/db_area/images/news/253377/fig03.png) Older games tent to reuse/recolor spires. Even when you get spires it might be really hard to put

OOP macro - problems with import

2018-12-08 Thread sayol
Hello, i really like OOP macro from [https://github.com/jyapayne/nim-extensions](https://github.com/jyapayne/nim-extensions). There are so far two problems * Cant figure out how should i define class as exported however this is kinda solvable by changing oop.nim code to export all *

Re: Nim vs D

2018-12-08 Thread moerm
FWIW I had a look at D multiple times and learned to fervently dislike it. My personal summary is that D is but yet another better C/C++ attempt with funny gadgets added and an utter lack of consistence in concept and design. To even put Nim and D next to each other is ridiculous.

Re: Extract sprite data from old DOS game resource file?

2018-12-08 Thread matkuki
> What's also possible, is that multiple pixels are stored in one byte. I don't > know the exact specs, though it might be possible that if a sprite can only > have four colors, each pixel is a palette color index stored in two bits > therefore a byte holds four pixels and the palette selector

Re: Nim vs D

2018-12-08 Thread Libman
" **I believe we are the language with the best static introspection in the world** " — [AA](https://en.wikipedia.org/wiki/Andrei_Alexandrescu) @ [Dconf 2018 in Munich](http://dconf.org/2018/index.html), three minutes into "[Ask Us

How does --gc:stack work?

2018-12-08 Thread emg
I'm curious as to know how exactly does --gc:stack work? I looked over the documentation but couldn't find much details. Is it similar to C++ constructors/destructors? Does GC still run in the background?

Re: Cast string to tuple?

2018-12-08 Thread Stefan_Salewski
Note that casting to a ref is dangerous, as ref's interfere with the Garbage-Collector. I guess when you really need a cast, you may want to cast to ptr instead of ref -- ptr is Nim's untraced pointer, similar to C's pointers.

Re: Cast string to tuple?

2018-12-08 Thread MarcL
I understand my mistake. t = cast[ref Raw_Frame](addr c) Run should be t = cast[ref Raw_Frame](addr c[0]) Run

Cast string to tuple?

2018-12-08 Thread MarcL
Hi, I just discovered Nim and already doing little toy projects with it to get used to it. Love it. I am playing with networking. But reading from raw sockets, I need to cast the string to a tuple which represent the headers fields. That would enable me to select any field of the

Re: Extract sprite data from old DOS game resource file?

2018-12-08 Thread doofenstein
I'm not very familiar with MS-DOS games, but I have a bit of knowledge about NES games. It might be possible that the data you're looking for is compressed. Something like RLE with small modifications wasn't uncommon on the NES, especially for storing level data. What's also possible, is that

Re: Advent of Code 2018 megathread

2018-12-08 Thread filip
Thank you, that means a lot :)

Re: Extract sprite data from old DOS game resource file?

2018-12-08 Thread treeform
Getting sprites out old dos game can be hard. You will not find standard images formats like png, jpg or dds. It can be stored in extremely convoluted way. One game I ripped the sprites from (Panzer General) used a strange pen method where it stored all images as move pen left, right, draw

Extract sprite data from old DOS game resource file?

2018-12-08 Thread matkuki
Hi guys, I have a couple resource files from an old MS-DOS game called `Zeliard`. The files have a `.sar` extension, if that is of any help. I would like to find out how the sprite information is stored in these files, but I have no knowledge of how it is `packed`. Some data for the game text

Re: How do you pass code blocks to when compiles?

2018-12-08 Thread gemath
> My intention was to check to see if a proc hello exists in the current scope > that doesn't conflict with the proc I'm about to create. A simple test call to the proc would do (`when compiles(hello()): ...`). But then, the compiler would issue an error anyway if there's a conflict with an

Re: Advent of Code 2018 megathread

2018-12-08 Thread miran
> I'm still learning Nim (...) Not a programmer by trade and it might show. I really like your solutions so far! And if you didn't explicitly tell, I wouldn't ever have guessed that you're just learning Nim nor that you're not a programmer.

Re: Advent of Code 2018 megathread

2018-12-08 Thread filip
Here is my repository: [https://github.com/filipux/adventofcode2018](https://github.com/filipux/adventofcode2018)