![]() |
[QUOTE=CRGreathouse;224801]I used to edit text on Windows with Crimson Editor, where I had a nice macro. I would type the name of the function and its arguments, like
[code]foo(a,b)[/code] and press the shortcut key to transform this to [code]foo(a,b)={ }; addhelp(foo, "foo(a, b): ");[/code] by appropriate use of 'duplicate line', 'next word', etc. functions. :smile: Now I'm using gedit on Linux and Notepad++ on Windows; I like them better, overall, but I have no such feature. Pity.[/QUOTE] I wanted to make something read the inputs and create the code even more. |
[QUOTE=science_man_88;224803]I wanted to make something read the inputs and create the code even more.[/QUOTE]
Sounds [url=http://en.wikipedia.org/wiki/AI-complete]AI-Complete[/url]. |
[QUOTE=CRGreathouse;224804]Sounds [url=http://en.wikipedia.org/wiki/AI-complete]AI-Complete[/url].[/QUOTE]
search the input for descriptive words or sentences like "all primes until n" if n is greater than primelimit warn the user or use for(1,n,if(isprime()) things like that. |
I agree, that would be very cool. But it's a hard task.
I was doing a problem that is somewhat similar: take natural language and see if it has a certain mathematical meaning. My source data was the OEIS; the goal was to determine which sequences represented quadratic equations ([url=http://math.crg4.com/oeis-quadratics.html]results here[/url]). But even at that very restricted task I found many problems: different ways to write polynomials and generating functions, differences in base variables, mentions of equations other than those defining the sequence, etc. For a more general-purpose task like this one, I can only imagine how much harder it would be. |
[QUOTE=CRGreathouse;224807]I agree, that would be very cool. But it's a hard task.
I was doing a problem that is somewhat similar: take natural language and see if it has a certain mathematical meaning. My source data was the OEIS; the goal was to determine which sequences represented quadratic equations ([url=http://math.crg4.com/oeis-quadratics.html]results here[/url]). But even at that very restricted task I found many problems: different ways to write polynomials and generating functions, differences in base variables, mentions of equations other than those defining the sequence, etc. For a more general-purpose task like this one, I can only imagine how much harder it would be.[/QUOTE] apparently embedded braces in parser is not supported by PARI go figure [CODE]scriptwriter(name,input()) = { print(name"() = {");addhelp(name,name"()"input());if(input()=="all primes until";if(n>primelimit,print(n"is greater than primelimit"));addhelp(name,name"():"input());[/CODE] |
[QUOTE=CRGreathouse]No thanks, that would be too much work. But feel free to work them out yourself if you like.
[/QUOTE] What the - It's not up to me to validate what you post! You do that! Prime-numbered post. Woo. |
[CODE]script(name) = print(name"()=");if(input()==,print("is n greater than primelimit?"))[/CODE]
can't figure out how to check strings the way I want can I fill in a vector with them ? if so can't I check strings like that ? |
[QUOTE=3.14159;224810]What the - It's not up to me to validate what you post! You do that![/QUOTE]
You asked me to find a general composite that was a pseudoprime to at least 20 bases, and I did that. You didn't ask for a list of the bases! If you want those you can generate them yourself. I imagine you can work mod each of the primes and CRT the results together. |
[QUOTE=science_man_88;224812][CODE]script(name) = print(name"()=");if(input()==,print("is n greater than primelimit?"))[/CODE]
can't figure out how to check strings the way I want can I fill in a vector with them ? if so can't I check strings like that ?[/QUOTE] You can certainly have strings in vectors: [code]["one", "two", "three"][/code] and even convert strings into vectors of characters [code]Vec("hi there")[/code] Is that what you wanted? |
[QUOTE=CRGreathouse]You asked me to find a general composite that was a pseudoprime to at least 20 bases, and I did that. You didn't ask for a list of the bases! If you want those you can generate them yourself. I imagine you can work mod each of the primes and CRT the results together.[/QUOTE]
I didn't ask for a list of bases? What is it that I ask for here, then: [QUOTE=3.14159]Please, tell me which 49 bases it is pseudoprime to.[/QUOTE] [B]I couldn't make it any more explicit than that.[/B] |
might work CRG also i got this working as wanted:
[CODE]script(name) = print(name"()=");if(input()==all primes upto,print("is n greater than primelimit?"))[/CODE] if I implement yours the hard part is telling how long the number(or it's representation) would be after this. nvm if I can check for spaces I just add a extra character onto my string I check for and then check for the next space and read the number encoded check if it's above the prime limit if so I warn them ask them if it should be changed if not I go with [CODE]for(x=1,#,if(isprime(x)))[/CODE] deal. |
| All times are UTC. The time now is 06:55. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.