Language: C++

/* converted by scratch2cpp (https://github.com/yos1up/scratch2cpp) */
#include <bits/stdc++.h>
#define debug cerr << "--" << __LINE__ << "--" << endl
using namespace std;

static int roundToInt(double x){
    return (x < 0) ? -(int)(-x + 0.5) : (int)(x + 0.5);
}

class Var{
public:
    string sval;
    double dval;
    enum VarType {STRING = 0, NUMBER = 1};
    VarType type;
    enum NumericState {UNKNOWN = -1, STRINGY = 0, NUMERIC = 1};
    mutable NumericState numericState;

    Var(){sval = ""; type = STRING; numericState = STRINGY;} // represent null?
    Var(string s){
        sval = s; type = STRING; numericState = UNKNOWN;
    }
    Var(double d){dval = d; type = NUMBER; numericState = NUMERIC;}
    Var(const Var &v){
        sval = string(v.sval); dval = v.dval;
        type = v.type; numericState = v.numericState;
    }
    static bool isNumericString(const string &s) {
        char* ep;
        strtod(s.c_str(), &ep);
        return !ep || !*ep;
        // TODO: In Scratch '000' is regarded as non-numeric (but here regarded as numeric)
    }
    bool isNumeric() const{
        if (type == NUMBER) return true;
        if (numericState != UNKNOWN) return numericState == NUMERIC;
        bool numeric = isNumericString(sval);
        numericState = (numeric) ? NUMERIC : STRINGY;
        return numeric;
    }
    double asNumber() const{
        if (type == NUMBER) return dval;
        return (isNumeric()) ? atof(sval.c_str()) : 0.0;
    }
    static bool isNearInteger(const double &x){
        return (fabs(round(x) - x) < 1e-8);
        // TODO: allow integer type in Var class
    }
    string asString() const{
        if (type == STRING) return sval;
        if (isNearInteger(dval)) return to_string(roundToInt(dval));
        return to_string(dval);
    }
    Var operator+(const Var &y) const{
        return Var(this->asNumber() + y.asNumber());
    }
    Var operator+=(const Var &y){
        *this = *this + y;
        return *this;
    }
    Var operator-(const Var &y) const{
        return Var(this->asNumber() - y.asNumber());
    }
    Var operator*(const Var &y) const{
        return Var(this->asNumber() * y.asNumber());
    }
    Var operator/(const Var &y) const{
        return Var(this->asNumber() / y.asNumber());
    }
    Var operator%(const Var &y) const{
        return Var(fmod(this->asNumber(), y.asNumber()));
    }
    bool operator<(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() < y.asNumber();
        }// compare as number if both can be interpreted as numeric
        return this->asString() < y.asString();
    }
    bool operator>(const Var &y) const{
        return y < *this;
    }
    bool operator==(const Var &y) const{
        if (this->isNumeric() && y.isNumeric()){
            return this->asNumber() == y.asNumber();
        }// compare as numeric if both are numeric
        return this->asString() == y.asString();
    }
    friend ostream& operator << (ostream& os, const Var& p);
    friend istream& operator >> (istream& is, const Var& p);
};
ostream& operator << (ostream& os, const Var& p){
    os << p.asString();
    return os;
}
istream& operator >> (istream& is, Var& p){
    string s; is >> s; p = Var(s);
    return is;
}

Var letterOf(Var index, Var sourceString){
    /* index: 1-origined */
    string str = sourceString.asString();
    int idx = (int)(index.asNumber() - 1);
    // seem to be dirty but Scratch seems to do like this.
    // ex. letterOf(0.01, "world") == "w", letterOf(1.99, "world") == "w", letterOf(5.99, "world") == "d"
    if (0 <= idx && idx < str.size()) return Var(str.substr(idx, 1));
    return Var();
}

// TODO: should we make a new class for vector<Var>?
Var getLineOfList(const Var &index, const vector<Var> &list){
    /* index: 1-origined */
    int idx = (int)index.asNumber() - 1;
    // (unlike 'letterOf', index==0.9 does not work.)
    if (0 <= idx && idx < list.size()) return list[idx];
    return Var();
}
void setLineOfListTo(const Var &index, vector<Var> &list, const Var &v){
    /* index: 1-origined */
    int idx = (int)index.asNumber() - 1;
    if (0 <= idx && idx < list.size()) list[idx] = v;
}
void deleteLineOfList(const Var &index, vector<Var> &list){
    /* index: 1-origined */
    int idx = (int)index.asNumber() - 1;
    if (0 <= idx && idx < list.size()) list.erase(list.begin() + idx);
}
void insertAtIndexOfList(const Var &item, const Var &index, vector<Var> &list){
    /* index: 1-origined */
    int idx = (int)index.asNumber() - 1;
    if (0 <= idx && idx <= list.size()) list.insert(list.begin() + idx, item);   
}
void insertAtRandomOfList(const Var &item, vector<Var> &list){
    int idx = rand() % (list.size() + 1);
    list.insert(list.begin() + idx, item);
}
Var contentsOfList(const vector<Var> &list){
    /* concatenate elements of list with space */
    string ret;
    for(int i=0;i<list.size();i++){
        if (i > 0) ret += ' ';
        ret += list[i].asString();
    }
    return Var(ret);
}

double randUniform(double x, double y){
    if (x > y) return randUniform(y, x);
    if (Var::isNearInteger(x) && Var::isNearInteger(y)){
        int xi = roundToInt(x), yi = roundToInt(y);
        return xi + rand() % (yi - xi + 1);
    }else{
        return x + (y - x) * (0.0 + rand()) / RAND_MAX;
    }
}

Var buf_answer; // for "answer"

// ============================= Scripts =============================
Var var_d(0);
Var var_r(0);
Var var_ret(3);
Var var_n_(3);
Var var_m_(0);
Var var_a(10000000000000);
Var var_b(1000000000000000000000);
Var var_n(3);
Var var_x(0);
Var var_ans(3);
Var var_i(3);

vector<Var> var_li = {};

int ntbdzj();
int lsnphv();
int cvxbuk();
int bxfxfv();
int hramlk();
int func_gcd(Var arg_n, Var arg_m);
int cmcdmf();
int zzrtom();
int gkywzw();
int qmtowe();
int dxkokz();
int zkmieg();
int main();

int djlrsy(){
    arg_n;
}

int jklqwi(){
    arg_n;
}

int xjfqox(){
    arg_m;
}

int vsdpft(){
    arg_m;
}

int jvfxbc(){
    arg_m;
}

int func_gcd(Var arg_n, Var arg_m){
    var_n_ = Var(fabs(arg_n.asNumber()));
    var_m_ = Var(fabs(arg_m.asNumber()));
    while (!((var_m_ == Var(0)))){
        var_r = (var_n_%var_m_);
        var_n_ = var_m_;
        var_m_ = var_r;
    }
    var_ret = var_n_;
}

int zjsmds(){
    func_gcd(Var(2231),Var(0));
    cout << var_ret << endl;
}

int cckptx(){
    (Var(22)%Var(0));
}

int oldvin(){
    (Var(10)%arg_m);
}

int odging(){
    arg_n;
}

int hbrcoh(){
    arg_m;
}

int unqjzm(){
    arg_n;
}

int main(){
    var_li.clear();
    cin >> buf_answer;
    var_n = buf_answer;
    cin >> buf_answer;
    var_x = buf_answer;
    for (int wufqmn=0;wufqmn<var_n.asNumber();wufqmn++){
        cin >> buf_answer;
        var_li.push_back((buf_answer-var_x));
    }
    var_ans = Var(0);
    var_i = Var(0);
    for (int zohwep=0;zohwep<var_n.asNumber();zohwep++){
        var_i+=Var(1);
        func_gcd(var_ans,getLineOfList(var_i, var_li));
        var_ans = var_ret;
    }
    cout << var_ans << endl;
}



Compiler output:
a.cc:166:11: warning: integer constant is too large for its type
  166 | Var var_b(1000000000000000000000);
      |           ^~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int djlrsy()':
a.cc:189:5: error: 'arg_n' was not declared in this scope
  189 |     arg_n;
      |     ^~~~~
a.cc:190:1: warning: no return statement in function returning non-void [-Wreturn-type]
  190 | }
      | ^
a.cc: In function 'int jklqwi()':
a.cc:193:5: error: 'arg_n' was not declared in this scope
  193 |     arg_n;
      |     ^~~~~
a.cc:194:1: warning: no return statement in function returning non-void [-Wreturn-type]
  194 | }
      | ^
a.cc: In function 'int xjfqox()':
a.cc:197:5: error: 'arg_m' was not declared in this scope
  197 |     arg_m;
      |     ^~~~~
a.cc:198:1: warning: no return statement in function returning non-void [-Wreturn-type]
  198 | }
      | ^
a.cc: In function 'int vsdpft()':
a.cc:201:5: error: 'arg_m' was not declared in this scope
  201 |     arg_m;
      |     ^~~~~
a.cc:202:1: warning: no return statement in function returning non-void [-Wreturn-type]
  202 | }
      | ^
a.cc: In function 'int jvfxbc()':
a.cc:205:5: error: 'arg_m' was not declared in this scope
  205 |     arg_m;
      |     ^~~~~
a.cc:206:1: warning: no return statement in function returning non-void [-Wreturn-type]
  206 | }
      | ^
a.cc: In function 'int func_gcd(Var, Var)':
a.cc:217:1: warning: no return statement in function returning non-void [-Wreturn-type]
  217 | }
      | ^
a.cc: In function 'int zjsmds()':
a.cc:222:1: warning: no return statement in function returning non-void [-Wreturn-type]
  222 | }
      | ^
a.cc: In function 'int cckptx()':
a.cc:226:1: warning: no return statement in function returning non-void [-Wreturn-type]
  226 | }
      | ^
a.cc: In function 'int oldvin()':
a.cc:229:14: error: 'arg_m' was not declared in this scope
  229 |     (Var(10)%arg_m);
      |              ^~~~~
a.cc:230:1: warning: no return statement in function returning non-void [-Wreturn-type]
  230 | }
      | ^
a.cc: In function 'int odging()':
a.cc:233:5: error: 'arg_n' was not declared in this scope
  233 |     arg_n;
      |     ^~~~~
a.cc:234:1: warning: no return statement in function returning non-void [-Wreturn-type]
  234 | }
      | ^
a.cc: In function 'int hbrcoh()':
a.cc:237:5: error: 'arg_m' was not declared in this scope
  237 |     arg_m;
      |     ^~~~~
a.cc:238:1: warning: no return statement in function returning non-void [-Wreturn-type]
  238 | }
      | ^
a.cc: In function 'int unqjzm()':
a.cc:241:5: error: 'arg_n' was not declared in this scope
  241 |     arg_n;
      |     ^~~~~
a.cc:242:1: warning: no return statement in function returning non-void [-Wreturn-type]
  242 | }
      | ^