Coder Social home page Coder Social logo

a-a-maly / kumir2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victor-yacovlev/kumir2

21.0 3.0 14.0 164.78 MB

New home for Kumir2.

License: GNU General Public License v2.0

CMake 1.97% Shell 0.09% Makefile 0.01% C++ 83.43% NSIS 0.10% Python 6.23% QML 0.75% HTML 0.33% CSS 0.17% JavaScript 0.14% Roff 5.11% Objective-C++ 0.02% C 0.56% Rich Text Format 1.09% VBScript 0.01%

kumir2's People

Contributors

1scar1 avatar a-a-maly avatar a1-triard avatar dfmordol avatar li2vin avatar velkerr avatar victor-yacovlev avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

kumir2's Issues

Hardly visible walls.

When editing Robot field newly put walls are barely distinctable from cell borders.
After changing field size (with '+' and '-' buttons) they become of normal width.

From: Берта
kumir2-2.1.0-rc7
При редактировании обстановки Робота при нажатии на границы клеток не видно их утолщения. В версии kumir-1.9.0 сразу видно, куда устанавливаешь стену, а в новой версии после ооочень долгих проб и ошибок пришла к выводу, что

  1. Либо ставить наугад вслепую, а потом очень сильно уменьшить масштаб, но только при идеальном зрении можно разглядеть их утолщения и редактировать при таком мелком изображении крайне сложно. Это не выход.
  2. Либо при каждом нажатии на границу увеличивать или уменьшать количество клеток на всём поле в высоту или в ширину. Это тоже не работа...

The system crashes when you try to type a number after stopping the execution

The bug is present both in #3571 builds and 2.1.0-rc11 builds

Steps to reproduce:

  1. Open practicum, Циклы с переменными,
  2. Launch any of two scripts, see prompt to input the parameters.
  3. Interrupt the execution by click on red square button
  4. Input any number anyway and hit enter

Observed result:
Segmentation fault.

Official repository location

Hello!

I recently built Kumir2 for FreeBSD and introduced some fixes. Now I wonder where is the official repository located so I will be able to submit patches.

Logging

How to save log files? Or see the logs in the console

It seems that task Циклы пока, Задача 3 from practicum.kurs.xml is impossible

The task has two test fields, which are visually same except that one has Б point marked and other unmarked.
Since the Робот cannot check the labels according to documentation and the fields are exactly same except this mark, the task is impossible to complete.

Похоже, что эта задача нерешаема. В качестве тестов два варианта поля, в одном точка Б помечена, а в другом нет.
Проверить, помечена ли точка невозможно изнутри студенческой версии.

Версия rc11, последняя.

Indentation is missing in *.kum files

Hello! When Kumir2 is saving a program into a file, resulting file is missing indentation, all operators starts at the very beginning of a line.
While having the IDE can restore the indentation of the code automatically, it's impractical to add automatic KuMir indentation to every single text editor which might be used for editing code.
Perhaps Kumir2 IDE should be modified to add indentation to the source file automatically? I suggest to add one \t character for each square bullet by default and have an option to change it to some amount of whitespaces in settings.

Сборка deb-пакетов для Debian/Ubuntu

В репозитории проекта присутствует папка "debian" для сборки deb-пакетов.
Но по всей видимости она устарела. Сборка пакетов по этим конфигам не проходит.
Файлы в "debian.nightly" ещё старше.

Было бы неплохо починить настройки для сборки deb-пакетов.

Я сделал свою версию debian-конфигов ("не стреляйте в пианиста..."), собрал пакеты в PPA:
https://launchpad.net/~rayanayar/+archive/ubuntu/kumir

Вот прямая ссылка на debian-конфиги:
https://launchpad.net/~rayanayar/+archive/ubuntu/kumir/+sourcefiles/kumir2/2.1.0.11git20210630-0ppa1~focal/kumir2_2.1.0.11git20210630-0ppa1~focal.debian.tar.xz

Компиляция под MacOS

Добрый день!

Как скомпилировать под Mac? Добавьте, пожалуйста, инструкцию.

Decoupling KuMir IDE from language itself

As it seems for me, KuMir language is basically Pascal with improved syntax (such as C-style var declaration) and Russian keywords. However it's missing some important features of Pascal, namely records (or structures) and pointers.
But, if those features would have been added, it would let KuMir become a general purpose programming language, which could be used to write useful programs.
However, if such thing happened it would be nice to have a version of KuMir without graphical user interface, which doesn't depend on Qt or other huge libraries, and can be coupled with regular text editors installed on machine instead of an IDE, perhaps losing some features, such as variable tracing, but being much faster and easier to install.
Of course, I am aware that many (or even most) KuMir programs depend on various Actors, such as Robot. However, this problem can be solved by having a well-defined interface between compiled kumir program and a library implementing an Actor, which in turn would allow to re-implement most Actors in ncurses, Xlib, Tk, Gtk+ or whatever.
A simplest and easiest to use, but not the most efficient solution would be using bidirectional text pipes between compiled executable and actor. Kumir would simply output commands for an actor and if commands had conditions in it, wait for response.
While it's going to be less efficient than a shared library, it would allow much wider range of Actors, including even real robots connected via RS-232 or TCP socket.
Though of course, a hybrid solution is also feasible: compiled program links with a library, which in turn converts library calls into text commands, but can be easily replaced with different library having same interface, but using graphical library directly.

I understand, that this discussion would be more appropriate to an internet forum, than a github issues, however, I am sadly is not aware of any forums where KuMir can be discussed.

Cannot create a QWidget without QApplication

$ /usr/bin/kumir2-checkcourse
10:45:34 INFO Logger started
10:45:34 DEBUG Begin initialization
10:45:34 DEBUG Arguments: ("/usr/bin/kumir2-checkcourse")
10:45:34 DEBUG AppName: [ "kumir2-checkcourse" ], PluginName: [ "ExtensionSystem" ]
10:45:34 DEBUG Initialized plugin manager
10:45:34 DEBUG Loading plugins by template: "ActorRobot,!CourseManager,KumirCodeGenerator,KumirCodeRun(console),KumirAnalizer(teacher,preload=Files,preload=Strings)"
10:45:34 DEBUG AppName: [ "kumir2-checkcourse" ], PluginName: [ "ActorRobot" ]
10:45:34 DEBUG Display ":0"
10:45:34 DEBUG CourseManager:GUI Mode
10:45:34 FATAL QWidget: Cannot create a QWidget without QApplication
Aborted (core dumped)

SIGSEGV под Wayland

ОС: openSUSE Tumbleweed (20230222)
Версия Qt в системе: 5.15.8
DE: KDE Plasma 5.27.0
Версии Кумира: 2.1.0-rc11.patch1 (из репозиториев OBS, ныне удалено), master/940162b (скомпилирован с Qt5)

При попытке запустить Кумир в Wayland-сессии, во время открытия редактора кода где-то через секунду вылетает, выдавая SIGSEGV. Под иксами всё работает.

Логи:
Кумир-Про 2.1.0-rc11
Кумир-Про master/940162b

UPD: также всё нормально запустится, если запускать с переменной среды QT_QPA_PLATFORM=xcb, т.е. принуждать использовать Xwayland. Тем не менее, это не решение, а костыль

калькулятор.kum не работает

Если закомментировать массиватор и стоп, то при вычислении первого же выражения выдаётся ошибка:

>> 12:43:14 - калькулятор.kum - Начало выполнения
ОШИБКА ВЫПОЛНЕНИЯ: Значение не строковое
>> 12:44:19 - калькулятор.kum - Выполнение завершено 64.908

Происходит это при вызове алгоритма "длин":

алг получи терминал(лит выражение, цел позиция, рез цел код токена)
нач
  цел длина_выражения
  длина_выражения := длин(выражение)
  если позиция > длина_выражения
    то 
      код токена := 8
    иначе
      выбор
         при выражение[позиция] = '+': код токена := 1
         при выражение[позиция] = '-': код токена := 2
         при выражение[позиция] = '*': код токена := 3
         при выражение[позиция] = '/': код токена := 4
         при выражение[позиция] = '(': код токена := 5
         при выражение[позиция] = ')': код токена := 6
         при выражение[позиция] = '1': код токена := 7
       иначе стоп
     всё
   всё
кон

И только тогда, когда длина строки равна 1. Для 0 и 2+ всё работает нормально.

Building with Qt 5.15.2 fails due to missing #include <QPainterPath> in src/plugins/editor/editorplane.cpp

Attempt to build the official source from https://git.niisi.ru/kumir/kumir2 fails when using -DUSE_QT=5 option with following error and multiple deprecated declaration warnings:

./src/plugins/editor/editorplane.cpp: In member function ‘void Editor::EditorPlane::paintLockSymbol(QPainter*, bool, const QRect&)’:
./src/plugins/editor/editorplane.cpp:2392:15: error: aggregate ‘QPainterPath path’ has incomplete type and cannot be defined
 2392 |  QPainterPath path;
      |               ^~~~

Thanks to thestr4ng3r/chiaki#253 I was able to locate the problem and fix it with:

diff --git a/src/plugins/editor/editorplane.cpp b/src/plugins/editor/editorplane.cpp
--- a/src/plugins/editor/editorplane.cpp
+++ b/src/plugins/editor/editorplane.cpp
@@ -16,6 +16,7 @@
 #include <QApplication>
 #include <QScrollBar>
 #include <QPainter>
+#include <QPainterPath>
 #include <QContextMenuEvent>
 #include <QMouseEvent>
 #include <QDrag>

After this trivial change, the build finished and the program started.

не получается вводить данные из файла.

Возможно, я делаю что-то не то, но вместо чтения из файла похоже, что КуМир пытается читать с консоли (см., что написано внизу в строке состояния).

Кумир 2.1.0-rc11, Windows

Код программы:

использовать Файлы
файл вхъ
сим с1,с2
цел макс,к
алг
нач
вхъ := открыть на чтение("C:\promo.yar\кумир\37131\24.txt")
начать чтение(вхъ)
к := 1
макс := 0
ввод вхъ,с1
нц пока есть данные(вхъ)
с2 := с1
ввод вхъ,с1
если с2 = 'K' и с1 = 'L' или с1 = 'K' и с2 = 'L' то
если к > макс то
макс := к
все
к := 1 
иначе
к := к + 1
все
кц
если к > макс то
макс := к
все
вывод макс
кон

ввод-из-файла

Clean warnings

There should be no compiler warnings with -O3 -Wall -W.
Lots of them may hide really dangerous ones.
warn1.log

Something should be done with -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS for VS compiler.

Remove -DNDEBUG -DQT_NO_DEBUG for Release build, asserts should be checked in production as well.
Remove -O2 for Release build, there is no reason to override default -O3.

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.