- Basic types:
Integer numbers. Includes:
Int
- largest native signed integer type available on current architecture- Differently sized signed and unsigned integers
Just some Lua snippets. |
var WOLFRAM_KEY = "<API KEY GOES HERE>"; | |
var local_cache = {}; | |
function wolfram_api_call(query, key) { | |
var response = UrlFetchApp.fetch("http://api.wolframalpha.com/v2/query?input=" + encodeURIComponent(query) + "&appid=" + key + "&format=plaintext"); | |
var xml = XmlService.parse(response); | |
var root = xml.getRootElement(); | |
First some context. There's a pretty cool old(er) game about exploration, colonization and programming called Colobot that got opensourced recently (github) and I found out that it has a somewhat active (Polish) community and they're working on improving, fixing, porting, etc. the game.
Now, this was one of my favorite childhood games and I had literally dozens of different visions as to how a potential sequel could look and decided that it's always better to do something than do nothing and just talk about my ideas, so I started with what I know best(better than 3D graphics and physics at least), which is programming language design (and also happens to be my favorite topic in all of IT, just how cool is that?) and work on designing an educational but powerful programming language.
A question most people would ask is why I won't just use Python or some other simple language. I say: While many of these languages are good, simple and powerful, I believe that if the main
In this tutorial, you will learn how to easily set up a development environment that will allow you to start learning and coding right away, with multiple helpful features that will make it easier, and the material you will start with will be making simple games using the Love2D framework.
Unlike most tutorials on the internet, I'm not going to focus on grinding down basic programming concepts and practices into you,
package com.asmoprime.utils; | |
/** | |
* ... | |
* @author Asmageddon | |
*/ | |
class Copy { | |
/** | |
* Deep copy of anything using reflection (so don't hope for much performance) | |
**/ |
static value random_int( value o, value max ) { | |
if (!val_is_int(max)) {fprintf(stderr,"std_random max is no int\n");} | |
else {fprintf(stderr,"std_random max is in fact an int\n");} | |
if (!val_is_int(o)) {fprintf(stderr,"std_random o is no int\n");} | |
else {fprintf(stderr,"std_random o is in fact an int\n");} | |
val_check_kind(o,k_random); | |
val_check(max,int); | |
if( val_int(max) <= 0 ) | |
return alloc_int(0); | |
return alloc_int( (rnd_int(val_rnd(o)) & 0x3FFFFFFF) % val_int(max) ); |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import wx | |
TASKBAR_ICON = "icon.png" | |
class ClipmanIcon(wx.TaskBarIcon): | |
def __init__(self): | |
wx.TaskBarIcon.__init__(self) | |
self.icon = wx.IconFromBitmap( wx.Bitmap(TASKBAR_ICON) ) |
import random, math | |
import re | |
def log_bin(value): | |
return math.log(value) / math.log(2) | |
def cumprod(values): | |
result = 1 | |
for i in values: | |
result *= i |
import sys, os, pygame, random | |
from pygame.locals import * | |
if not pygame.font: print 'Warning, fonts disabled' | |
if not pygame.mixer: print 'Warning, sound disabled' | |
screen_x = 512 | |
screen_y = 512 | |
tile_x = 24 | |
tile_y = 24 |