explain what is missing from 10print - basic

10 PRINT CHR$(205.5+RND+(1));:GOTO 10
I seem to be the only person ever to not be able to do this. i have written all kinds of BASIC but I can't do anything with this. What am i missing?
I get "SYNTAX ERROR IN 10"
i can't get it to work And really, why would it? 205 is a memory address and so the value of 5 in and we have random number thing going but where does the pattern come from. Don't we need? "/" "\ ".
205.5 produces these/??? that doesn't make any sense. I must have an extreme misunderstanding of computers and BASIC that curiously doesn't prevent me from creating functioning programs.
I also program in C and I am still completely clueless. never seen anything like this work seems like there is a hidden line 1,2,3,4,5,6,7,8,9, that wasn't listed so I don't know what the rest of the code is???
I've tried on the 64mini and several emulators and they all give the same error.
Did I have a stroke and need to goto the hospital? maybe I can no longer discern what I see on the screen Lol.
10 PRINT CHR$(205.5+RND+(1));:GOTO 10

As pointed out by teapot418, you have a typo in your code. The exact code is:
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
CHR$ creates the ASCII character for the given number. (What you wrote about reading from address is PEEK.)
CHR$(205) gives you the "\" and CHR$(206) the "/". The floating part of the number gets ignored. Because of the randomness, you get random sequences of CHR$(205) and CHR$(206) which creates the maze. The ; at the end of PRINT avoids a newline.

Related

Algorithm for finding what is misspelled in a word

Im dyslexic and so im trying to make a console application to test my spelling. When I misspell a word i print the correction out. The issue is if I spell "matter" as "mater" i wont notice that im missing a t form first glance. So i want to highlight certain types of errors. Assuming that you the computer knows the word you are trying to spell. Is there an algorithm that can identify missing character, wrong characters or extra characters eg an extra t in "watter" instead of "water". The amount of missing or extra characters is arbitrary. I should just relise there is something missing or extra and what it is.
Ideally do something like this

Getting an invalid syntax <Unknown, line 6> error for print function w/ Pylint on VSCode

For my weekly course assignment, we're tasked w/ creating simple user entry points for a fictional employee. I ran the code once and everything worked out as I needed it to w/ it asking the user to input data, once input it presented it w/ a title. I forgot to add a field for the employeeName and the "----" lines, so I added all of that in, copy and pasting some of it to get done as the code is highly similar. I then got the syntax error. I checked my spelling for print, deleted the print function, and then used VS Code intellisense to autofill the function, no changes to the error, went through the line to see if I forgot something or added extra nonsense. I looked through similar posts, but they aren't quite getting at my specific issue from what I can tell. Any help is much appreciated.
Regards
# user input for an employee's SSN
print("Please enter your SSN #:", end=' ')
employeeSSN = input(str())
print('SSN:', employeeSSN)
print("PLease enter your SSN #:", end=' ')
^
SyntaxError: invalid syntax
Expected results should print the string inside quotations and allow for user input.
I found my own error after some more checking and testing. I forgot to put in an ending parenthesis for line 4 of my code. I found it by taking away the last set of things I worked on and retesting to a good point, then slowly re-adding in the rest. I noticed the missing parenthesis in that process. I wish the error would have pointed my towards that missing part in line 4 then on line 6 and the function. Had me thinking something totally different.
Example of code mess-up
print("----------------------------", employeeName, "----------------------------"
How I fixed it
print("----------------------------", employeeName, "----------------------------")
Sometimes, its the simplest things right in our face. Hopefully this helps someone else.

VBA string comparison failure

i met interesting issue when im comparing two strings. Im reading data from file and everything works well. But then co-worker send me input file, which is just CTRL+C and CTRL+V of working file. And then miracle happend! VBA is so confused, that cant compare two simple strings and i fell of chair.
If you take a look at image you can see that comparison passed if condition where are two same strings, but it should not. Im a bit confused how this can happen.
So met someone something like this? Im realy start thinking about something like machine revolution from Terminator. (files are both saved in notepad++ and there are no strange characters or something like that)
Progress update
So i tried hints from guys in comments below. and ended with something like this
If CStr(Trim(rowArray(4))) <> (CStr("N/A")) Then
Contentent of rowArray(4) is still "N/A" string as on picture above and excel still thinks this strings arent same. I also saved file in pspad, netbeans, and normal notepad and issue is still same.
Use the immediate window to test the contents of the variable:
For i = 1 To Len(rowArray(4)): Print Asc(Mid(rowArray(4), i, 1)): Next
This will print the ASCII value of each character in the string - you can use this to determine what the extra character(s) are causing the issue.

PutS only displaying one character on TI-84 Plus Silver edition

I have recently discovered that my TI-84 plus silver edition can be programmed in hex. I have been messing around with it but have had a few bugs. Whenever I try to make a bcall to PutS it only prints one character and moves on. If I add a second PutS command it puts the second letter down and to the right by one. My current code is:
AsmPrgm
219D9D
EFD9481C
C9
48692100
Necro reply: It seems like you are using one of the new Math Print OSes. Because of the "pretty print" math, TI had to change how strings are printed to the screen. Unfortunately, they broke older functions that as _PutS. One way to get around it is to just put your calc into Classic mode. This disables math print, so printing characters to the homescreen will work as expected.
Go to [Mode],[down] 8 times, [right], [Enter]
It works on my 84+ too. There is nothing wrong with this program.
Possible solutions:
Check if you typed in the hexadecimal correctly.
Perhaps you are using a different OS version that has the bcall at a different location in memory. My os version is 2.43 (no mathprint)
Good luck!

GHCI character limit?

I'm using ghci to do some incremental development using Emacs' run-haskell. Every once in a while, I get an error that looks like
<interactive>:[line]:[character]: _Lexical error at character '\EOT'
Setting up an intermediate variable or two gets a working response, and the file I'm working on both loads and compiles properly. Reducing character count also works; the max I seem to be able to hit is 252.
Anyone have an idea of what's going on?
This was filed and closed as a bug in GHC several years ago, so looks like no dice on fixing it at the GHCi end. (Searching "_Lexical error at character '\EOT'" gives a few other results (for example), but I can't work out how applicable they are.)

Resources