![]() |
|
|
#1849 |
|
Aug 2006
3·1,993 Posts |
"No passwords in plain text" has nothing to do with comments in source code.
|
|
|
|
|
|
#1850 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
My encode of rle isn't perfect for example:
RLE(hello world) = 1H1e2l1o1w1o1r1l1d RLE("Hello world") = 1H1e2l1o101w1o1r1l1d so they don't code out the same and so my decode will likely have to compensate unless my encode is redone. |
|
|
|
|
|
#1851 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Code:
(12:54) gp > checkstring(string) = eval(vector(Vec(Str(string)))) %90 = (string)->eval(vector(Vec(Str(string)))) (12:56) gp > checkstring(string) *** vector: gtos expected an integer, got '["s", "t", "r", "i", "n", "g"]'. actually maybe not you'd have to check if it's not a number list, Oh well my mistake again... Last fiddled with by science_man_88 on 2010-12-01 at 17:01 |
|
|
|
|
|
#1852 | |
|
Aug 2006
3·1,993 Posts |
Quote:
Passing strings without quotes causes serious issues and does not work in all cases. Don't do it. (When you do this, what's actually happening is you're sending monomials which are evaluated to their own names (!), but if a values becomes associated you'll see that instead of what you wanted.) Your improper use of eval() caused the space to be read as 0 rather than as a space. |
|
|
|
|
|
|
#1853 | |
|
Aug 2006
3·1,993 Posts |
Quote:
type(0) is t_INT type(1/2) is t_FRAC type(x^3 + 1) is t_POL type(x) is t_POL type(hello) is t_POL type("hello") is t_STR and so forth. |
|
|
|
|
|
|
#1854 |
|
"Forget I exist"
Jul 2009
Dumbassville
838410 Posts |
Code:
(13:18) gp > for(x=1,10,print1(x);if(x!=10,print1(",")))
1,2,3,4,5,6,7,8,9,10
(13:18) gp > for(x=1,10,print1(x);if(x==10,break());print1(","))
1,2,3,4,5,6,7,8,9,10
(13:19) gp > for(x=1,9,print1(x);print1(","));print(10)
1,2,3,4,5,6,7,8,9,10
(13:20) gp > for(x=1,9,print1(x","));print(10)
1,2,3,4,5,6,7,8,9,10
|
|
|
|
|
|
#1855 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
http://rosettacode.org/wiki/Pattern_matching
right up my alley just not sure what i want to do for it. |
|
|
|
|
|
#1856 | |
|
Aug 2006
3·1,993 Posts |
Quote:
|
|
|
|
|
|
|
#1857 | ||
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
Quote:
never mind dah if statements lol. Last fiddled with by science_man_88 on 2010-12-01 at 17:46 |
||
|
|
|
|
|
#1858 |
|
Aug 2006
10111010110112 Posts |
I can't quite follow you, but
Code:
n=0;
while(1,
print1(n++);
if(n>9, break);
print1(", ")
);
|
|
|
|
|
|
#1859 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
so in other words if(string==type(0) ||string==type(1/2), print("this string is numerical")) would work ? Though I haven't covered floating point types.
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |