Jump to content




Displaying characters in grid


  • You cannot reply to this topic
5 replies to this topic

#1 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 06 March 2016 - 11:01 AM

Kind of like what I've seen Bomb Bloke do, I was hoping to be able to see ascii characters in a grid. pretty much 8*4, with characters 127 - 159.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 March 2016 - 11:39 AM

I for one am unsure what you mean. What was the question? Are you talking about this sort of thing?

#3 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 06 March 2016 - 07:19 PM

I think he means like the gif on this

#4 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 09 March 2016 - 08:07 AM

Yeah, what dragon said. for example:

a b c d
e f g h
i j k l
m n o p


#5 valithor

  • Members
  • 1,053 posts

Posted 09 March 2016 - 08:18 AM

You just have to loop through the range and use string.char to get the numbers

ex:

term.setCursorPos(1,1)

for i = 128, 159 do
  if (i-128)%8 == 0 and i~=128 then
	print("")
  end
  term.write(string.char(i).." ")
end

note 127-159 is 33 characters, so it will not fit evenly in a 8*4 pattern.

Edited by valithor, 09 March 2016 - 08:22 AM.


#6 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 09 March 2016 - 09:11 AM

View Postvalithor, on 09 March 2016 - 08:18 AM, said:

You just have to loop through the range and use string.char to get the numbers

ex:

term.setCursorPos(1,1)

for i = 128, 159 do
  if (i-128)%8 == 0 and i~=128 then
	print("")
  end
  term.write(string.char(i).." ")
end

note 127-159 is 33 characters, so it will not fit evenly in a 8*4 pattern.

Thanks for the help :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users