-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
Rajesh Gautam edited this page Jun 12, 2026
·
1 revision
pcType{"Hello, World!"}\
pcAsk{"What is your name? "}\
pcType{"Hello, " + input{ans} + "!"}\
var{a, 10}\
var{b, 5}\
var{sum, var{a} + var{b}}\
pcType{"Sum: " + var{sum}}\
var{score, 85}\
if{var{score} >= 90, then}-
pcType{"Grade: A"}\
elif{var{score} >= 80, then}-
pcType{"Grade: B"}\
elif{var{score} >= 70, then}-
pcType{"Grade: C"}\
else:
pcType{"Grade: F"}\
--\
var{n, 10}\
while{var{n} > 0}-
pcType{var{n}}\
var{n, var{n} - 1}\
--\
pcType{"Blast off!"}\
var{total, 0}\
for{i, 1, 6}-
var{total, var{total} + var{i}}\
--\
pcType{"Sum 1–5: " + var{total}}\
createFunc{greet}-
pcType{"Hello from Curl!"}\
--\
func{greet}\
pcAI.context{"You are a helpful assistant."}\
pcAI.chat{""}\
var{topic, "black holes"}\
pcAI.context{"You are a science teacher."}\
var{explanation, pcAI.ask{"Explain " + var{topic} + " in one sentence."}}\
pcType{var{explanation}}\
var{name, "Ritvik"}\
var{score, 95}\
pcType{"Hello, " + var{name} + "!"}\
if{var{score} >= 90, then}-
pcType{"Excellent!"}\
else:
pcType{"Keep going!"}\
--\
createFunc{celebrate}-
pcType{"Congratulations!"}\
--\
for{i, 0, 3}-
func{celebrate}\
--\
var{reply, pcAI.ask{"Say something encouraging to " + var{name}}}\
pcType{var{reply}}\