-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfatt.R
60 lines (47 loc) · 855 Bytes
/
fatt.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Modifichei2
# Questo codice fa schifo, va rifatto da capo!!
# Modifica tsh di prova
source('some_stuff.R')
fatt<-function(n)
{
if(n<=1){return(1)}
# Ritorno il cazzo
return(n*fatt(n-1))
}
write(fatt(4),stdout())
fun_M <- function(x)
{
return(2*x)
}
fun_M2 <- function(p)
{
return(p*p)
}
fun_M2 <- function(p)
{
#ciao ciao ciao Mandelli
#commento di OBS
return(p*p*p)
}
funzOBS <- function(x)
{
return(x)
}
funzprova <- function(x)
{
# commento tsh
# cazzi volanti in 4D e non funzionera` mai
#commento Mandelli
return(x)
}
#PROVAAAAAAAAAAAAAAAA
area <- function (width, height, string){
if(string=='Rectangle'){
area <- width * height
}
if(string=='Triangle'){
area <- (width*height)/2
}
if(string!='Rectangle' & string!='Triangle') cat(paste('Pirla, scegli rettangolo o triangolo!', '\n', sep=''))
return(area)
}