Skip to content

Commit 3896a6c

Browse files
committed
added code examples documentation
1 parent ac246d7 commit 3896a6c

File tree

1 file changed

+162
-0
lines changed

1 file changed

+162
-0
lines changed

doc/examples.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#PipelineScript Examples
2+
3+
###print
4+
5+
PipelineScript
6+
```
7+
print "hello world"
8+
```
9+
10+
Java
11+
```java
12+
System.out.println("hello world");
13+
```
14+
15+
Output
16+
```
17+
hello world
18+
```
19+
20+
###var_text
21+
22+
PipelineScript
23+
```
24+
text x = "foobar"
25+
print x
26+
```
27+
28+
Java
29+
```java
30+
String x = "foobar";
31+
System.out.println(x);
32+
```
33+
34+
Output
35+
```
36+
foobar
37+
```
38+
39+
###var_num
40+
41+
PipelineScript
42+
```
43+
num x = 42
44+
print x
45+
```
46+
47+
Java
48+
```java
49+
double x = 42;
50+
System.out.println(x);
51+
```
52+
53+
Output
54+
```
55+
42.0
56+
```
57+
58+
###arith_add
59+
60+
PipelineScript
61+
```
62+
num x = 4
63+
num y = 2
64+
print x + y
65+
```
66+
67+
Java
68+
```java
69+
double x = 4;
70+
double y = 2;
71+
System.out.println(x + y);
72+
```
73+
74+
Output
75+
```
76+
6.0
77+
```
78+
79+
###arith_sub
80+
81+
PipelineScript
82+
```
83+
num x = 4
84+
num y = 2
85+
print x + y
86+
```
87+
88+
Java
89+
```java
90+
double x = 4;
91+
double y = 2;
92+
System.out.println(x - y);
93+
```
94+
95+
Output
96+
```
97+
2.0
98+
```
99+
100+
###arith_mult
101+
102+
PipelineScript
103+
```
104+
num x = 4
105+
num y = 2
106+
print x * y
107+
```
108+
109+
Java
110+
```java
111+
double x = 4;
112+
double y = 2;
113+
System.out.println(x * y);
114+
```
115+
116+
Output
117+
```
118+
8.0
119+
```
120+
121+
###arith_div
122+
123+
PipelineScript
124+
```
125+
num x = 4
126+
num y = 2
127+
print x / y
128+
```
129+
130+
Java
131+
```java
132+
double x = 4;
133+
double y = 2;
134+
System.out.println(x / y);
135+
```
136+
137+
Output
138+
```
139+
2.0
140+
```
141+
142+
###text_concat
143+
144+
PipelineScript
145+
```
146+
text x = "foo"
147+
text y = "bar"
148+
print x + " " + y
149+
```
150+
151+
Java
152+
```java
153+
String x = "foo";
154+
String y = "bar";
155+
System.out.println(x + " " + y);
156+
```
157+
158+
Output
159+
```
160+
foo bar
161+
```
162+

0 commit comments

Comments
 (0)