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)

CRGreathouse 2010-12-02 23:33

[QUOTE=science_man_88;239765]I stupidly recycled it lmao.[/QUOTE]

Well, now you know what it does. You can also look inside it to see what else it can do.

science_man_88 2010-12-02 23:48

[QUOTE=CRGreathouse;239773]Well, now you know what it does. You can also look inside it to see what else it can do.[/QUOTE]

now I have a way to tell if i'm an idiot oh wait this forum already has a way wonder if i can code it lol, just joking.

science_man_88 2010-12-03 01:05

1 Attachment(s)
I have started to recollect codes I tried here and I made a .gp file and got gp reading it.

but:

[CODE](21:02) gp > FaR("I hate you Alex","Alex","loser")
*** not a function: `FaR'.[/CODE]

even though(codes.gp):

[CODE]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]

I uploaded as a text because a .gp isn't allowed lol

CRGreathouse 2010-12-03 16:17

You probably aren't reading in the right file, then. :unsure:

If you have a file like this with all the functions you normally use, I strongly recommend reading it from your .gprc file so
1. You don't need to type the command to read it in each session
2. If you make changes to the file and want to read in those changes, you can just type "\r" instead of "\r filename.gp" since it already has the proper file loaded in the 'last file used' internal string.

science_man_88 2010-12-03 16:30

1 Attachment(s)
first file

science_man_88 2010-12-03 16:31

1 Attachment(s)
second file

science_man_88 2010-12-03 16:45

I must have the read set up wrong because I can paste the function in and I'm not given (c)-> stuff to show it's entered but then i can use it but if I don't I don't get it to work.

CRGreathouse 2010-12-03 17:44

Let's try something first. Can you go to the command prompt for me? (Start, Run, then type cmd and press Enter.) Once there, type

[code]cd "C:\Program Files\PARI"
dir codes.*[/code]

Tell me what shows up.

science_man_88 2010-12-03 18:23

[QUOTE=CRGreathouse;239843]Let's try something first. Can you go to the command prompt for me? (Start, Run, then type cmd and press Enter.) Once there, type

[code]cd "C:\Program Files\PARI"
dir codes.*[/code]

Tell me what shows up.[/QUOTE]

[CODE]Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\[SPOILER]flec[/SPOILER]>cd "C:\Program Files\PARI"

C:\Program Files\PARI>dir codes.*
Volume in drive C has no label.
Volume Serial Number is [SPOILER]684A-E086[/SPOILER]

Directory of C:\Program Files\PARI

12/03/2010 01:42 PM 2,670 codes.gp
1 File(s) 2,670 bytes
0 Dir(s) 210,214,907,904 bytes free

C:\Program Files\PARI>[/CODE]

CRGreathouse 2010-12-03 18:43

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?

science_man_88 2010-12-03 18:48

[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]

nothing I also can't get rid of a drive I don't know how it came to be but I can virus scan it any way to get rid of it ? I supposedly don't have the permission to do anything but virus scan.


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

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