Giter Site home page Giter Site logo

iewnfod / caie_code Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 7.0 8.18 MB

An Interpreter for CAIE Pseudocode

Home Page: https://muyunxi.top/cpc

License: Mozilla Public License 2.0

Python 97.12% Shell 1.88% Rust 0.97% PowerShell 0.04%
interpreter programming-language pseudocode python3

caie_code's Introduction

Hi, I'm Iewnfod

  • 😙 My name is Wu ZiQian / Iewnfod
  • 🏫 Studying in Ulink College of Shanghai
  • ⚡ Rust / TypeScript / Python3
  • 🪐 Video Games / Music / Animation

Github Contributions

Iewnfod's Github Stats Iewnfod's Github Language Use
github contribution grid snake animation

Support My Projects

caie_code's People

Contributors

bbwanjia avatar chengyushun avatar dianliang233 avatar iewnfod avatar lightumcc avatar soap-tpst avatar xiuzenb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

caie_code's Issues

SVG Logo font

问题描述

SVG 的字体貌似不是嵌入进去的,所以如果“Baron Neue”字体没有安装,Logo 的字体就是渲染器自己随便选的。

另外现在矢量版和栅格版的 Logo 都用的是“Baron Neue”字体,许可证上没有明确写可不可以用在图片里(倒是说了可以用在 PDF 文件和网页里),所以考不考虑换个字体什么的?

复现方法

  1. 删除 Baron Neue 字体
  2. 浏览器打开 CPC 主页,看到:

Screenshot_20231109_102719

你的代码

No response

操作系统类型

Linux

操作系统版本

rolling

Python版本

3.x

额外说明

No response

Different grammars in the new syllabus

问题描述

In old syllabus (2021):
image

In new syllabus (2023,2024-2025):
image

复现方法

DECLARE stack : ARRAY[1:10] OF INTEGER  // Stack array with a capacity of 10 elements
DECLARE topPointer : INTEGER            // Points to the top element of the stack
DECLARE basePointer : INTEGER           // Points to the base of the stack
DECLARE stackFull : INTEGER             // Indicates the full capacity of the stack

basePointer <- 1
topPointer <- 0
stackFull <- 10

PROCEDURE popElement
    DECLARE item : INTEGER
    IF topPointer = basePointer - 1 THEN
        OUTPUT "Stack is empty"
    ELSE
        item <- stack[topPointer]
        OUTPUT item, " is popped from stack"
        topPointer <- topPointer - 1
    ENDIF
ENDPROCEDURE

版本信息

Version 0.1.4 (dev/2c0b586)
Using [ PyPy 3.10.13 ] on Darwin
Current Version Notes: Bug fix: wrong char remove

额外说明

9618_pseudocode(1).pdf

The latest version of the syllabus has been committed on be80ff7

移除 Rust

功能描述

貌似找 Python 这样的功能在头上加一层 Rust 还是有点太笨重了吧(

不如用 sh & pwsh 重新实现一遍,这样也省掉 build 了

功能样例

额外说明

No response

Manual page

功能描述

A good code interpreter should have a manual page which can be easily accessed from the shell view.
However when I tried $ man cpc I got this
Screenshot 2023-09-08 at 16 08 48
Hopefully the author could add the manual from standard man command; the shown manual page could be the same as the output from $ cpc -h.

功能样例

$ man cpc
Screenshot 2023-09-08 at 16 15 03

额外说明

No response

Error in type arrays

问题描述

The follow code gives a error

TYPE shit
	DECLARE i:INTEGER
ENDTYPE

DECLARE arr: ARRAY[1:10] OF shit

arr[3].i <- 8

OUTPUT arr[3].i

image

复现方法

Run the following code

TYPE shit
	DECLARE i:INTEGER
ENDTYPE

DECLARE arr: ARRAY[1:10] OF shit

arr[3].i <- 8

OUTPUT arr[3].i

操作系统类型

Windows

操作系统版本

win10

Python版本

3.8.5

额外说明

太烂了赶紧修复

Use stderr for all prompts

功能描述

一般解释器提示语都应该输出到 stderr 上。比如说运行 python3 然后输入 print("hello"),stdout 应该只有

hello

而 stderr 才是

Python 3.11.5 (main, Sep  2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> >>>

功能样例

如果把提示语全都转换输出到 stderr 里,就可以用 shell 做一些有用的操作:

cpc 1>./out 2>/dev/null <<CPCEND
OUTPUT "hello"
CPCEND

额外说明

No response

"INTPUT"

问题描述

When I type "Input", it writes "Intput"

复现方法

Type Input

版本信息

0.1.6

额外说明

No response

Enumeration Type Error

Discussed in #87

Originally posted by McPhir April 25, 2024
For example (like the example in the guide).
I am trying t odo this:
Type Season = (Spring,Summer,Winter,Autumn)
DECLARE ThisSeason : Season
ThisSeason <- Season.Spring
OUTPUT ThisSeason

//not a complaint. The extension is very good.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.