![]() |
|
|
#1992 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
http://rosettacode.org/wiki/Five_weekends may need it to check. on another topic one thing I liked to do in javascript was what I called rainbow background ( pretty much settimeouts() and color changes going through the rainbow for the background color of the page (you could do this with frames of a movie I think for background image), for the first one is there anything like this in PARI best I can think of is like a rate counter but with a default color change as the code), with Javscript you could turn the effect all the way to 1 ms per color ( bound to give someone epileptic shock)) Last fiddled with by science_man_88 on 2010-12-04 at 13:02 |
|
|
|
|
|
|
#1993 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
http://rosettacode.org/wiki/Sudoku
"partially filled-in normal 9x9 Sudoku grid" But it looks as though you make one to start as it doesn't give one ! random(9) anyone lol just have to check i'th row the row the number is in and a 3 by 3 box that is the hard part. I wanted to make matrix(3*matrix(3,3),3*matrix(3,3)) but it doesn't work lol. |
|
|
|
|
|
#1994 |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
Code:
{for(n=1,100,
print(if(n%3,
if(n%5,
n
,
"Buzz"
)
,
if(n%5,
"Fizz"
,
"FizzBuzz"
)
))
)}
Last fiddled with by science_man_88 on 2010-12-04 at 20:27 |
|
|
|
|
|
#1995 |
|
Aug 2006
3×1,993 Posts |
Now that I think about it, you could even do
Code:
DayOfWeek(JD)={
["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"][round(JD)%7+1]
};
|
|
|
|
|
|
#1996 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Code:
isnumerical(string)=if(type(string)==t_INT || type(string)==t_REAL || type(string)==t_FRAC || type(string)==t_COMPLEX,return(1),return(0)) http://rosettacode.org/wiki/Determin...ing_is_numeric |
|
|
|
|
|
#1997 | ||
|
Aug 2006
3·1,993 Posts |
Quote:
Code:
isnumerical(string)=my(t=type(string));t=="t_INT" || t=="t_REAL" || t=="t_FRAC" || t=="t_COMPLEX"; Quote:
For example, isNumericString("123") should return 1, while isNumericString("1+1") and isNumericString("foo") should return 0. |
||
|
|
|
|
|
#1998 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Quote:
I've tried every combo of Vec string and eval I can think of to try and take it out of string form but I can't make it work. Last fiddled with by science_man_88 on 2010-12-05 at 01:32 |
|
|
|
|
|
|
#1999 | |
|
Aug 2006
10111010110112 Posts |
Quote:
You then also need to check for real numbers, which may be of the form (integer). (integer).(+integer) .(+integer) (integer)e(integer) (integer).e(integer) (integer).(+integer)e(integer) .(+integer)e(integer) Oh yes, and the two forms starting with . can also have a + or - prepended. And the e can be capital. You could also check for rationals and complex numbers, but you could probably submit without. |
|
|
|
|
|
|
#2000 | |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Quote:
|
|
|
|
|
|
|
#2001 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#2002 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
|
|
|
|
![]() |
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 |