Re: attaching multiple constants to 1 string
At post 13, read the language tutorial and check the examples.To insert a new line into a string, just write \r\n. So, for example:string multiline_string="This string\r\nspans\r\nmultiple lines.";Same to insert a quotation mark int
Re: attaching multiple constants to 1 string
MacOS is just as weird -- it uses \r as its new line. Which is just odd
URL: http://forum.audiogames.net/post/395911/#p395911
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: attaching multiple constants to 1 string
@13: It sounds like you haven't read about escape sequences. \n (new line), \r (carriage return, aka newline for windows because windows is weird like that), \" (a quote in a string literal), \', \\, \t (tab), etc.I don't think I understand
Re: attaching multiple constants to 1 string
@13, yeah, BGT doesn't have raw string literals, also known as here documents. Quite sad, that; here documents are incredibly useful.
URL: http://forum.audiogames.net/post/395739/#p395739
--
Audiogames-reflector mailing list
Audiogames
Re: attaching multiple constants to 1 string
Still not seeing the problem? Fundamentally, it's a set of rules for parsing strings. Implementing those rules might not be as easy as fizzbuzz, but I'm not sure what would make it so much harder as to require DLLs or built-in support. We're
Re: attaching multiple constants to 1 string
@9, uh... because regular expressions are a lot more powerful than that?
URL: http://forum.audiogames.net/post/395699/#p395699
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: attaching multiple constants to 1 string
... Why? Why can't I just look up the most common rules and write an implementation like it's that expr assignment from CS102? I mean, aside from the fact that I'm not sure if I finished that assignment or not...?
URL: http
Re: attaching multiple constants to 1 string
If you were using regular expressions (and if the function was just called "match") you could just do:if (match(currentloc, "^house[0-9]$")) {//...}Believe me, your not going to get regular expressions in BGT any time so
Re: attaching multiple constants to 1 string
Someone could probably hack together functions for working with regular expressions, if they haven't already. There'd need to be equivalents for equals, contains, replace, and split, and that would probably cover it.
URL: http
Re: attaching multiple constants to 1 string
I should have mentioned what language I am using, sorry for being so dumb. I am a bgt user. And @ post 5, yes, you interpreted my question correctly. BGT needs to be updated to support expressiions such as that one.
URL: http
Re: attaching multiple constants to 1 string
If you want the example you gave, to shorten if (cl == "house1" or cl == "house2") etc, you might tryif (string_left(cl, 5) == "house" and string_to_number(string_trim_left(cl, 5)) <= 5)IDR if python slices w
Re: attaching multiple constants to 1 string
If you want the example you gave, to shorten if (cl == "house1" or cl == "house2") etc, you might tryif (string_left(cl, 5) == "house" and string_to_number(string_trim_left(cl, 5)) <= 5)IDR if python slices w
Re: attaching multiple constants to 1 string
It depends on how your structuring your data, using Classes with dictionaries or multi-dimensional lists can be a good way to keep track of location data or doing checks and iteration. For example you could put a house class in a dictionary
Re: attaching multiple constants to 1 string
Maybe you can make an array and you can loop through the items. If array.find or something. You never said what language you were using so...
URL: http://forum.audiogames.net/post/395578/#p395578
--
Audiogames-reflector mailing list
Re: attaching multiple constants to 1 string
sorry for posting twice. I just realized this may not be possible since you have to state whether the condition is and, or or. But maybe there is a way to shorten it even if the method I was thinking of doesn't work. Let me know if you have
15 matches
Mail list logo