Skip to content

Instantly share code, notes, and snippets.

@bmacho
Last active September 14, 2025 19:39
Show Gist options
  • Select an option

  • Save bmacho/b0327ec63d1f509574a999e7434be367 to your computer and use it in GitHub Desktop.

Select an option

Save bmacho/b0327ec63d1f509574a999e7434be367 to your computer and use it in GitHub Desktop.
try_picat.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Why change this"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/bmacho/b0327ec63d1f509574a999e7434be367/try_picat.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"source": [
"!wget -c \"https://picat-lang.org/download/picat39_linux64.tar.gz\" > /dev/null 2>&1\n",
"# 3.4MB so it's probably fine to download it every day\n",
"\n",
"!tar -xvzf \"picat39_linux64.tar.gz\" -C . > /dev/null\n",
"\n",
"!echo 'picat binary is at /content/Picat/picat'"
],
"metadata": {
"collapsed": true,
"id": "EBLl0Ln0gvis"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "hIKPOGmUewYr"
},
"outputs": [],
"source": [
"# you can create a file\n",
"\n",
"%%shell\n",
"\n",
"cat <<MultiString > welcome.pi\n",
"\n",
" main =>\n",
" print(\" Welcome to PICAT’s world! \\n \").\n",
"\n",
" main(Args) =>\n",
" print(\" Welcome to PICAT’s world! \\n\"),\n",
" foreach (Arg in Args)\n",
" printf(\"%s \\n\", Arg)\n",
" end.\n",
"\n",
"MultiString\n",
"\n",
"# welcome.pi created at /content/welcome.pi"
]
},
{
"cell_type": "code",
"source": [
"# run it by\n",
"\n",
"!/content/Picat/picat welcome a b c"
],
"metadata": {
"id": "W6mppa9XfUqs"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"Alternatively, you can open a terminal by clicking 'Terminal' at the bottom left bar\n",
"\n",
"---\n",
"\n",
"An official guide is located at\n",
"\n",
"https://picat-lang.org/download/picat_guide_html/picat_guide.html#x1-370002\n",
"\n",
"Chapter 2 How to Use the Picat System"
],
"metadata": {
"id": "tiMp-6PBjRuD"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment