BAM: _LETCHR$ and _GETCHR$ - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: QBJS, BAM, and Other BASICs (https://qb64phoenix.com/forum/forumdisplay.php?fid=50) +--- Thread: BAM: _LETCHR$ and _GETCHR$ (/showthread.php?tid=1646) Pages:
1
2
|
RE: BAM: _LETCHR$ and _GETCHR$ - CharlieJV - 05-09-2023 (05-09-2023, 07:22 PM)bplus Wrote: Oh yours looks like tiling on a slant, with pixel offsets?, as opposed to filling "character cells" straight up and down or across fills. That should be an easy question to answer, but I'm struggling. Maybe we can get somewhere by analysing the code in chunks. Code: (Select All) CreateGraphicsChars: Every image is created with two custom 8x8 characters. The first character, each pixel is randomly set on or off. The second character is the equivalent of result of flipping the first character on the vertical axis and again on the horizontal axis. The _LETCHR$ function will assign a new character to the identified ASCII code, and based on the specification in the 64-character string parameter. (One character per pixel, "X" meaning pixel on, "." meaning pixel off. So the subroutine above creates two strings, first one to generate a new character for ASCII code 0, the second one (diagonal flippy of the first) assigned to ASCII code 1. 50-50 chance of a pixel being turned on: Code: (Select All) FUNCTION defPixel$() Let's make sure all of that makes sense, then we can look at the next thing. RE: BAM: _LETCHR$ and _GETCHR$ - mnrvovrfc - 05-09-2023 (05-09-2023, 07:22 PM)bplus Wrote: Do you suppose an 8x8 cell is ideal for neat looking designs? Is you Random fill 50/50? The post #9 of this thread had cool pictures. That comes from 8x8 pixel "character block". Otherwise it becomes too limited to represent what younger people have become accustomed to with the "emojis". Look at what had to be done to get the "open" and filled smiley-faces, and the playing card suits. Cannot look at them too closely LOL... It needs to be greater than 8 pixels across besides being taller. Even 32x32 for icons is too restrictive sometimes in color. This is something I discovered using Windows Paint and creating an icon for FLAC. Now I don't even think about it on Linux since that allows PNG files of pretty much any square at least 16x16, and it supports transparency. RE: BAM: _LETCHR$ and _GETCHR$ - CharlieJV - 05-09-2023 Dang it, every pattern is so interesting that I can veg out on this all frigging day... RE: BAM: _LETCHR$ and _GETCHR$ - CharlieJV - 05-09-2023 (05-09-2023, 07:55 PM)CharlieJV Wrote:(05-09-2023, 07:22 PM)bplus Wrote: Oh yours looks like tiling on a slant, with pixel offsets?, as opposed to filling "character cells" straight up and down or across fills. Now for chunk 2: Code: (Select All) PrintTiles: Not much special here. Print (note the semi-colon to do no carriage return) groups of three characters 80 times. In another bit of code, the first line is made to be blank. 3 characters 80 times, 240 characters in all. At 20 characters per row, 12 rows of characters. (screen being 160 pixels wide by 112 pixels tall. Reference: BAM's screen modes.) Code: (Select All) SCREEN _NEWIMAGE(160, 112, 14) Before going into the loop, we pick a pattern to use (0, 1, or 2). I like the "rule of thirds" in photography, so each pattern has the "diagonal-flippy character" once, and the other two characters are the straight generated one. The idea here is to make sure that however number of characters in the pattern, the total number of character-width of the screen cannot be divided neatly (i.e. there will be a remainder) by the number of characters in the pattern. So we never have a column of text with the one character repeated throughout. That makes for a more interesting pattern. RE: BAM: _LETCHR$ and _GETCHR$ - bplus - 05-09-2023 Ah after trying to replicate your screen shots, I was correct it was more than just laying out one tile over the whole screen. Charlie you are right, those patterns have more of an allure to them than my simple minded idea of one tile alone over whole screen. The upside down flip allows a bilateral symmetry which is more attractive to us bilateral humans but not AI I bet RE: BAM: _LETCHR$ and _GETCHR$ - CharlieJV - 05-10-2023 (05-09-2023, 09:41 PM)bplus Wrote: Ah after trying to replicate your screen shots, I was correct it was more than just laying out one tile over the whole screen. Oh good, I'm glad you figured that out because the wheels were spinning over here but the hamster was getting nowhere. Yes, bilateral symmetry, unlike my two left feet. RE: BAM: _LETCHR$ and _GETCHR$ - CharlieJV - 05-10-2023 Version two (a two-colour version to demonstrate "layering" of characters with "PutString") in the BAM: PUTSTRING prototyping thread. |