<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Printer</title>
		<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer</link>
		<description>Posts in the discussion thread &quot;Printer&quot; - How can I make this faster?</description>
				<copyright></copyright>
		<lastBuildDate>Wed, 22 Apr 2026 15:14:10 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4235537</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4235537</link>
				<description></description>
				<pubDate>Wed, 01 May 2019 18:15:42 +0000</pubDate>
				<wikidot:authorName>kg583</wikidot:authorName>				<wikidot:authorUserId>2203149</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>HEX0, HEX1, HEX2, etc. are all list names. Just type them in as their letters.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4235471</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4235471</link>
				<description></description>
				<pubDate>Wed, 01 May 2019 16:50:25 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Where do you find ¨Hex0¨?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233412</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233412</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 22:26:57 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Now, you have to keep in mind that when you are reading all of the pixels on the graph screen, the operations will take a while. However, here are the two programs I made as samples. I made them for monochrome, but it should only be a matter of adjusting the window size for color.</p> <p>Reader:</p> <div class="code"> <pre><code>//Define the hex value mapping {0,0,0,0→HEX0 {1,0,0,0→HEX1 {0,1,0,0→HEX2 {0,0,1,0→HEX3 {0,0,0,1→HEX4 {1,1,0,0→HEX5 {1,0,1,0→HEX6 {1,0,0,1→HEX7 {0,1,1,0→HEX8 {0,1,0,1→HEX9 {0,0,1,1→HEXA {1,1,1,0→HEXB {1,1,0,1→HEXC {1,0,1,1→HEXD {0,1,1,1→HEXE {1,1,1,1→HEXF {0,0,0,0→READ &quot;?→Str0 //Define the screen size //This example is for a monochrome calculator such as the TI-84 0→Xmin:94→Xmax 0→Ymin:62→Ymax For(Y,Ymin,Ymax-2,2 For(X,Xmin,Xmax-2,2 pxl-Test(Y,X→ʟREAD(1 pxl-Test(Y,X+1→ʟREAD(2 pxl-Test(Y+1,X→ʟREAD(3 pxl-Test(Y+1,X+1→ʟREAD(4 Pxl-Change(Y,X If 0=sum(ʟREAD:Str0+&quot;0→Str0 If 1=sum(ʟREAD:Then If not(sum(ʟREAD≠ʟHEX1:Str0+&quot;1→Str0 If not(sum(ʟREAD≠ʟHEX2:Str0+&quot;2→Str0 If not(sum(ʟREAD≠ʟHEX3:Str0+&quot;3→Str0 If not(sum(ʟREAD≠ʟHEX4:Str0+&quot;4→Str0 End If 2=sum(ʟREAD:Then If not(sum(ʟREAD≠ʟHEX5:Str0+&quot;5→Str0 If not(sum(ʟREAD≠ʟHEX6:Str0+&quot;6→Str0 If not(sum(ʟREAD≠ʟHEX7:Str0+&quot;7→Str0 If not(sum(ʟREAD≠ʟHEX8:Str0+&quot;8→Str0 If not(sum(ʟREAD≠ʟHEX9:Str0+&quot;9→Str0 If not(sum(ʟREAD≠ʟHEXA:Str0+&quot;A→Str0 End If 3=sum(ʟREAD:Then If not(sum(ʟREAD≠ʟHEXB:Str0+&quot;B→Str0 If not(sum(ʟREAD≠ʟHEXC:Str0+&quot;C→Str0 If not(sum(ʟREAD≠ʟHEXD:Str0+&quot;D→Str0 If not(sum(ʟREAD≠ʟHEXE:Str0+&quot;E→Str0 End If 4=sum(ʟREAD:Str0+&quot;F→Str0 Pxl-Change(Y,X End End sub(Str0,2,length(Str0)-1→Str0</code></pre></div> <p>Printer:</p> <div class="code"> <pre><code>//Define the hex value mapping {0,0,0,0→HEX0 {1,0,0,0→HEX1 {0,1,0,0→HEX2 {0,0,1,0→HEX3 {0,0,0,1→HEX4 {1,1,0,0→HEX5 {1,0,1,0→HEX6 {1,0,0,1→HEX7 {0,1,1,0→HEX8 {0,1,0,1→HEX9 {0,0,1,1→HEXA {1,1,1,0→HEXB {1,1,0,1→HEXC {1,0,1,1→HEXD {0,1,1,1→HEXE {1,1,1,1→HEXF {0,0,0,0→PRNT //Define the screen size //This example is for a monochrome calculator such as the TI-84 0→Xmin:94→Xmax 0→Ymin:62→Ymax ClrDraw AxesOff GridOff Full Str0→Str2 For(Y,Ymin,Ymax-2,2 For(X,Xmin,Xmax-2,2 Pxl-Change(Y,X sub(Str2,1,1→Str1 Pxl-Change(Y,X If Str1=&quot;0&quot;:Goto S If Str1=&quot;1&quot;:ʟHEX1→ʟPRNT If Str1=&quot;2&quot;:ʟHEX2→ʟPRNT If Str1=&quot;3&quot;:ʟHEX3→ʟPRNT If Str1=&quot;4&quot;:ʟHEX4→ʟPRNT If Str1=&quot;5&quot;:ʟHEX5→ʟPRNT If Str1=&quot;6&quot;:ʟHEX6→ʟPRNT If Str1=&quot;7&quot;:ʟHEX7→ʟPRNT If Str1=&quot;8&quot;:ʟHEX8→ʟPRNT If Str1=&quot;9&quot;:ʟHEX9→ʟPRNT If Str1=&quot;A&quot;:ʟHEXA→ʟPRNT If Str1=&quot;B&quot;:ʟHEXB→ʟPRNT If Str1=&quot;C&quot;:ʟHEXC→ʟPRNT If Str1=&quot;D&quot;:ʟHEXD→ʟPRNT If Str1=&quot;E&quot;:ʟHEXE→ʟPRNT If Str1=&quot;F&quot;:ʟHEXF→ʟPRNT Pxl-Change(Y,X If ʟPRNT(1:Then:Pxl-On(Y,X:Else:Pxl-Off(Y,X:End If ʟPRNT(2:Then:Pxl-On(Y,X+1:Else:Pxl-Off(Y,X+1:End If ʟPRNT(3:Then:Pxl-On(Y+1,X:Else:Pxl-Off(Y+1,X:End If ʟPRNT(4:Then:Pxl-On(Y+1,X+1:Else:Pxl-Off(Y+1,X+1:End Lbl S If length(Str2)&gt;1:sub(Str2,2,length(Str2)-1→Str2 End End</code></pre></div> <p>The way I did it is probably not the fastest or cleanest, but it works and shows what I was trying to say</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233228</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233228</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 16:44:01 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>cool!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233180</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233180</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 15:48:11 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I'll draw up some sample code later when I have more time</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233151</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233151</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 15:18:18 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I have not heard of this method before. How do you do this?</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233057</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233057</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 13:40:35 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>O.o My head hurts from reading this.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4233051</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4233051</link>
				<description></description>
				<pubDate>Mon, 29 Apr 2019 13:33:54 +0000</pubDate>
				<wikidot:authorName>CloudVariable</wikidot:authorName>				<wikidot:authorUserId>4590504</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I remember doing something like this last year, except that it would keep list data in a picture variable. It was really slow, and the binary compression was a bit slow, but it stored numbers 0-255 in 8-bit binary partitions. It was great for game file storage, and my friend who was writing an RPG for the +CE at the time ended up using it for game storage. My calculations at the time showed that it could hold a max of 265 * 165 = 43725b, and therefore using 8 bit partitions could hold 5465 numbers. Eventually we decided to optimise this for the game, and we were able to process all of the data with matrix multiplication by moving partitions of data into matrices. On a bit of a tangent regarding the power of matrices in these instances, a couple of weeks ago I used matrices to write a program for calculating discrete Fourier transforms, more of a novelty than anything else. Without matrices, the program ran for 86 seconds at best. With matrices, it took about 3 seconds. My point is that in my experience, matrices are able to simplify programs handling plotting information on the graph screen.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4231796</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4231796</link>
				<description></description>
				<pubDate>Sun, 28 Apr 2019 01:28:09 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>My &quot;hex&quot; compression would also work with larger bases too, although it grows quickly. To account for all the permutations, its 2^n where n is the number of pixels in the group. I just used hex as its a fairly common base, easy to work with, and easy to &quot;read&quot;. If you went with a 3*2 grouping of pixels it would make your string about 3,000 points shorter, but would increase the amount of comparisons you would have to do in determining the proper compression value. Going from a group of 4 pixels to a group of 6 pixels is the same as going from Hex encoding to Base64 encoding.</p> <p>Another option might be run length encoding, but would be hard to make it reliably fall within the 999 limit of lists. Basically, you record the state at which the pixel is, and how many in a row there are. The wikipedia article on it explains it fairly well.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4231680</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4231680</link>
				<description></description>
				<pubDate>Sat, 27 Apr 2019 20:25:56 +0000</pubDate>
				<wikidot:authorName>kg583</wikidot:authorName>				<wikidot:authorUserId>2203149</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>If you want to stick with list-based storage, then base 10 compression is an alternative. A group of 46 pixels (treated as binary digits) can be converted into a single 14-digit number in base 10 (the precision of numerical storage is 14 digits, and <span class="math-inline">$2^{47}$</span> is just a tad too large), and with 164x264 = 43296 pixels to store this amounts to 942 list entries. Just barely within the limit! It's not quite as clean as <span class="printuser avatarhover"><a href="http://www.wikidot.com/user:info/trenly" ><img class="small" src="http://www.wikidot.com/avatar.php?userid=1905506&amp;amp;size=small&amp;amp;timestamp=1696959540" alt="Trenly" style="background-image:url(http://www.wikidot.com/userkarma.php?u=1905506)" /></a><a href="http://www.wikidot.com/user:info/trenly" >Trenly</a></span>'s hex compression, but it allows for list manipulation if that's something you need to do.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4231622</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4231622</link>
				<description></description>
				<pubDate>Sat, 27 Apr 2019 18:15:07 +0000</pubDate>
				<wikidot:authorName>Trenly</wikidot:authorName>				<wikidot:authorUserId>1905506</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Have you thought about compression? If you take each group of n*n pixels, and call that a point, you could possibly store the points instead of pixels using a conversion table. For example, with a 2*2 point layout, it generates 16 possible values, which could correspond to hex values 0-F.</p> <div class="code"> <pre><code>00 00 10 00 01 00 00 10 00 01 11 00 10 10 10 01 01 10 01 01 00 11 11 10 11 01 10 11 01 11 11 11</code></pre></div> <p>If you scan the screen in this way, you cut the number of rows and columns in half. You then read those 4 pixels, and determine the layout. Then you take the hex equivalent for that point layout and store it to a string.</p> <p>This would mean a string like: “0A15F” would correspond to the following points, where 1 is on and 0 is off:</p> <div class="code"> <pre><code>0000010011 0011000111</code></pre></div> <br /> Repeat for each group of pixels. You also then only are limited by string memory, and not list memory.
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4231582</guid>
				<title>Re: Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4231582</link>
				<description></description>
				<pubDate>Sat, 27 Apr 2019 16:53:21 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ok so after trying it out some more, I realized that there are way to many pixels to store. Only like 2% of the entire screen can be stored (assuming that the screen has all of its pixels turned on) because the list can only hold 999 numbers.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-11315751#post-4227623</guid>
				<title>Printer</title>
				<link>http://tibasicdev.wikidot.com/forum/t-11315751/printer#post-4227623</link>
				<description></description>
				<pubDate>Tue, 23 Apr 2019 17:15:13 +0000</pubDate>
				<wikidot:authorName>OneLetterShor</wikidot:authorName>				<wikidot:authorUserId>4737965</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This code has no usefulness, but it looks cool. You draw anything on the graph screen, and the program will store it to L₁ and L₂. The way it works is it scans the whole graph for turned-on pixels using pxl-Test( and stores their X &amp; Y pixel coordinates to L₁ and L₂, respectively. It then clears the graph screen and prints out the image, pixel by pixel. The problem is that the scanning/storing part is really slow on my TI-84 Plus CE. And I mean reeeeeeaaaaaaaly slow. If their is any way to speed the program up, please let me know.</p> <div class="code"> <pre><code>ClrHome 1→dim(L₁ 1→dim(L₂ For(Y,0,164 For(X,0,264 If pxl-Test(Y,X Then augment(L₁,{X→L₁ augment(L₂,{Y→L₂ End End End ClrDraw For(X,2,dim(L₁ Pxl-On(L₂(X),L₁(X),BLACK End</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>