mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

science_man_88 2010-12-03 18:59

[QUOTE=CRGreathouse;239854]Hmm, that looks fine. (From your shot of the Explorer window I thought it might have been named codes.gp.txt since Notepad likes to tack that on the names of all files.)

Try this: Open a new GP session and type ?0. What do you get?[/QUOTE]

well i used notepad to change it so that's why it shows it. I see 3 files windows doesn't recognize lol. could that be part of it lol.

That's why [CODE][COLOR="Red"]*** [pipe:] 'C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6 -fromgp '@1'' failed.[/COLOR][/CODE] pops up. gphelp isn't recognized so it can't open it.

CRGreathouse 2010-12-03 19:05

You must be typing the wrong thing because what I asked you to type doesn't use gphelp. (??gcd uses gphelp but ?0 does not.)

Here's what it look like on my Windows machine:
[code]11:13>?0

A059389 AKS Crocker
DickmanRho FaR LambertW
Li Mfactor Pascals_triangle_puzzle
Psi R RLE
bad bases bestappr2
bigdiv bigfactor binomialInterval
binomialIntervalEst bisect check
contfracback countPowerful countSquarefree
countweird dag deBruijnXi
diffset digits eps
findPeakedMax findrec findrecd
first firstbig foo
forbigprime generalizedBinomial go
gpf guess_the_number guessnumber2
hamming ierfc initial
is is1 isSPRP
isTriangular isabundant isprimepower
isprimitiveroot istwo isweird
largestSquareFactor latest lg
li list list1
lpf lucaslehmer medial
oddres pBounds palindrome
piBounds ppi prC
---- (type RETURN to continue) ----

prC2 precpow2 predicate
primeZeta primorial quad
rad repeat res3
reverse rhoest rsp
secant_root sopf star
sumdigits sumpolyk sumset
sunconj term test
testA064708 testA064708_1 testA064708_2
testrange trinv vecgcd
veclcm vecprod vecsum
ways2 ways3[/code]

By contrast, here's ??gcd:
[code]14:03>??gcd
*** [pipe:] 'C:/Program\ Files\ (x86)/PARI/perl.exe C:/Program\ Files\ (x86)
PARI/gphelp -cu 6 -fromgp 'gcd@3'' failed.[/code]

science_man_88 2010-12-03 19:06

[QUOTE=CRGreathouse;239858]You must be typing the wrong thing because what I asked you to type doesn't use gphelp. (??gcd uses gphelp but ?0 does not.)

Here's what it look like on my Windows machine:
[code]11:13>?0

A059389 AKS Crocker
DickmanRho FaR LambertW
Li Mfactor Pascals_triangle_puzzle
Psi R RLE
bad bases bestappr2
bigdiv bigfactor binomialInterval
binomialIntervalEst bisect check
contfracback countPowerful countSquarefree
countweird dag deBruijnXi
diffset digits eps
findPeakedMax findrec findrecd
first firstbig foo
forbigprime generalizedBinomial go
gpf guess_the_number guessnumber2
hamming ierfc initial
is is1 isSPRP
isTriangular isabundant isprimepower
isprimitiveroot istwo isweird
largestSquareFactor latest lg
li list list1
lpf lucaslehmer medial
oddres pBounds palindrome
piBounds ppi prC
---- (type RETURN to continue) ----

prC2 precpow2 predicate
primeZeta primorial quad
rad repeat res3
reverse rhoest rsp
secant_root sopf star
sumdigits sumpolyk sumset
sunconj term test
testA064708 testA064708_1 testA064708_2
testrange trinv vecgcd
veclcm vecprod vecsum
ways2 ways3[/code][/QUOTE]

I know I'm saying now I know why when i do the help it doesn't work lol.

CRGreathouse 2010-12-03 19:09

[QUOTE=science_man_88;239860]I know I'm saying now I know why when i do the help it doesn't work lol.[/QUOTE]

Start a new session and do it again. I suspect what you actually typed was ??0 or ?? which are entirely different (and do go through gphelp, [i]unlike[/i] ?0).

science_man_88 2010-12-03 19:11

[QUOTE=CRGreathouse;239861]Start a new session and do it again. I suspect what you actually typed was ??0 which is entirely different (and does go through gphelp, [i]unlike[/i] ?0).[/QUOTE]

[CODE](15:10) gp > ?0


(15:10) gp > ??
*** [pipe:] 'C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6 -fromgp '@1'' failed.
(15:10) gp >
[/CODE]

CRGreathouse 2010-12-03 19:15

Great, so ?0 worked.

Would you post your .gprc again?

science_man_88 2010-12-03 19:16

[QUOTE=CRGreathouse;239864]Great, so ?0 worked.

Would you post your .gprc again?[/QUOTE]

[QUOTE] colors = "boldfg"
datadir = "C:/Program Files/PARI"
[COLOR="Red"]help = "C:/Program Files/PARI/perl.exe C:/Program Files/PARI/gphelp -cu 6"
prettyprinter = "C:/Program\\ Files/PARI/perl.exe C:/Program\\ Files/PARI/tex2mail -TeX -noindent -ragged -by_par"[/COLOR]
prompt = "(%H:%M) gp > " read "codes.gp"[/QUOTE]

that help ?

science_man_88 2010-12-03 19:19

[CODE]reverse(string)={
my(v=Vec(Str(string)),c="");
forstep(y=#v,1,-1,
c=concat(c,v[y])
);c
};
repeat(string,x)={
for(y=1,x,
print1(string)
);
};
guessnumber2(b)={
my(c=0,d=b,a=0);
for(x=1,b,
for(y=1,b,
if(a<c||a==c||a==d||a>d,
a=random(b),
break()
)
);
print("I guess "a" am I h,l,or e ?");
g=input();
if(g==h,
d=a,
if(g==l,
c=a,
if(g==e,
break()
)
)
)
);
};
palindrome(string) ={
my(string=eval(Vec(Str(string))));
for(x=1,ceil(#string/2),
if(string[x]!=string[#string-(x-1)],
break(),
return(string)
)
);
};
Pascals_triangle_puzzle(topvalue=151,leftsidevalue=40,bottomvalue1=11,bottomvalue2=4) = {
y=(topvalue-(4*(bottomvalue1+bottomvalue2)))/7;
x=leftsidevalue-(y+2*bottomvalue1);
z=y-x;
print(x","y","z);
};
pascals_triangle(N)= {
my(row=[],prevrow=[])
for(x=1,N,
if(x>5,break(1));
row=eval(Vec(Str(11^(x-1))));
print(row));
prevrow=row;
for(y=6,N,
for(p=2,#prevrow,
row[p]=prevrow[p-1]+prevrow[p]);
row=concat(row,1);
prevrow=row;
print(row);
);
};
RLE(string)={
my(number=1,string=eval(Vec(Str(string))),Letter=string[1]);
for(x=2,#string,
if(string[x]==Letter,
number+=1,
print1("("number")"Letter);
Letter=string[x];
number=1)
);print1("("number")"Letter)
};
guess_the_number(N=10)={
my(a=random(N));
print("guess the number between 0 and "N);
for(x=1,N,
if(x>1,
print("guess again")
);
b=input();
if(b==a,
break()
)
);
print("You guessed it correctly")
};
sumdigits(n) ={
if(n%9!=0,
return(n%9),
return(n%9+9)
);
};
lucaslehmer(p)={
s=Mod(4, 2^p-1);
for(x=1,p-2,
s=s^2-2
);
if(s==0,1,0);
};
FaR(string_to_search,string_to_find,string_to_replace_with)={
my(s1=Vec(string_to_search),s2=Vec(string_to_find),s3=string_to_replace_with,good,c="",d="");
for(i=0,#s1-#s2,
good=1;
for(j=1,#s2,
if(s2[j]!=s1[j+i],
good=0;
c=concat(c,s1[i+1]);
break
)
);
if(good,
d=concat(c,s3);
print1(d);
c="";i=i+#s2
)
);
};
[/CODE]

this is my code file.

CRGreathouse 2010-12-03 19:26

[QUOTE=science_man_88;239865]that help ?[/QUOTE]

Yes. Change it to
[code]colors = "boldfg"
datadir = "C:/Program Files/PARI"
prompt = "(%H:%M)"
read "codes.gp"[/code]

science_man_88 2010-12-03 19:28

[QUOTE=CRGreathouse;239868]Yes. Change it to
[code]colors = "boldfg"
datadir = "C:/Program Files/PARI"
help = "C:/Program Files/PARI/doc/users.pdf "
prompt = "(%H:%M)
read "codes.gp"[/code][/QUOTE]

[CODE]Reading GPRC: /cygdrive/c/Program Files/PARI/.gprc ...
*** expected character: '"' instead of.
...skipping line 4.
Done.

GP/PARI CALCULATOR Version 2.4.2 (development CHANGES-1.1971)
i686 running cygwin (ix86/GMP-4.2.1 kernel) 32-bit version
compiled: Dec 23 2007, gcc-3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
(readline v5.2 enabled, extended help enabled)

Copyright (C) 2000-2006 The PARI Group

PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

parisize = 4000000, primelimit = 500000
*** error opening input file: codes.gp
^--------
... skipping file 'codes.gp'
?[/CODE]

CRGreathouse 2010-12-03 19:33

Oops, missed the closed quote. I corrected my above post.


All times are UTC. The time now is 23:08.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.