Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-8081-

High Level Languages that aren't shit

Name: Anonymous 2011-12-03 3:45

Do any exist? I've been looking for something like a high level C. The closest thing is probably Lua, but that's obviously unacceptable. Plus Lua is more C++ and less C. I liked Perl, but Perl 6 is not so good and has left a bad taste in my mouth.

Name: Anonymous 2011-12-03 3:51

If it ain't Lisp, it's crap.

Name: Anonymous 2011-12-03 3:54

>>2
I'm looking for something more like a high level C, not a Lisp language.

Name: Anonymous 2011-12-03 4:10

High level C? Use Go or possibly D.

Name: Anonymous 2011-12-03 4:12

C is a high level programming language.

Name: Anonymous 2011-12-03 4:14

>>2
Lisp is shit.

Name: Anonymous 2011-12-03 5:03

>>5
No it's not.

Name: Anonymous 2011-12-03 5:09

>>7
retard,
yes it is,you can use natural words and most of the time you don't deal with registers an shit

Name: Anonymous 2011-12-03 5:25

>The closest thing is probably Lua
Lua is nothing like C, functions are first-class, dynamic typing, etc; but perhaps you are saying this because it is embedded in C?

>Plus Lua is more C++ and less C
full retard

>I liked Perl, but Perl 6 is not so good and has left a bad taste what is wrong with you.

IHBT

Name: Anonymous 2011-12-03 5:42

>>8
oh you fucking retard now you just done it. high level is relative you jew

Name: Anonymous 2011-12-03 5:46

Common Lisp can be used like a high-level C with some macros and displaced arrays trickery.

Name: Anonymous 2011-12-03 5:47

>>9
Lua does have a very strong C feel to it.

>Plus Lua is more C++ and less C
full retard

What the fuck is this bullshit? Who would deny that Lua is closer to C++ than C?

Fuck off now.
Perl 6 is worse than it was.

Name: Anonymous 2011-12-03 5:48

>>11
Common Lisp's syntax is retarded and it isn't powerful enough to justify it.

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-03 5:52

>>1
You want something like D2.05x(Digital Mars D) with garbage collector turned off and using C libraries.
It won't be as fast as Real C in some cases, but you can work around that.

Name: Anonymous 2011-12-03 7:07

>>12

Lua does have a very strong C feel to it.

Are you fucking retarded?

What the fuck is this bullshit? Who would deny that Lua is closer to C++ than C?

Lua is no where near C++ or C.

You must have confused Lua with JavaScript. If you have had said JavaScript I could maybe see your point of view.

Name: Anonymous 2011-12-03 7:09

>>1
Don't sound so hopeless! It's true you'll never meet a good high-level language in person, but there are plenty of ways to be close to her without ever needing to meet her - you can play against (or as) her in the Touhou games themselves, or collect images of her from the 'boorus, or read doujin involving her, or even get a dakimakura.

Or you could kidnap a young Japanese girl, dye her hair grey, dress her as a good high-level language, and keep her locked up in your house. The choice is yours.

Name: Anonymous 2011-12-03 7:12

>>15
You're a fucking retard kill yourself. C++ influenced Lua the most.

Name: Anonymous 2011-12-03 7:53

>>17
Especially array indices, right?

Name: Anonymous 2011-12-03 9:22

Use D, it's really awesome
what C++ should have been

Name: Anonymous 2011-12-04 0:47

>>18

fak o an de yu fu `````````f'''''.

>>15

the only thing that javascript has in common with c is syntax with curly braces, idioms like for loops, and encouraged mutable state.

Name: Anonymous 2011-12-04 0:49

I'd be content with C with namespaces, which could be accomplished easily with a script that compiles c with namespaces to c with name mangling.

Name: Anonymous 2011-12-04 0:58

>>21
why do you want namespaces? they are worthless

Name: Anonymous 2011-12-04 1:28

>>15
You must have confused Lua with JavaScript
why the fuck would you insult javascript like that

Name: Anonymous 2011-12-04 1:39

>>22

they can help reduce typing, and line noise when reading.

Name: Anonymous 2011-12-04 2:37

>>17

The language that influenced Lua the most is Scheme.

The only thing it really got from C++ is being able to declare a local variable without introducing a new level of indentation.


Anyway, "like C" is very vague, OP. Please be more specific.

>>23
implying Lua is not just JS done right.

Name: Anonymous 2011-12-04 2:41

>>1
The closest thing is probably Lua, but that's obviously unacceptable.

why?

Name: Anonymous 2011-12-04 2:58

I liked Perl, but Perl 6 is not so good and has left a bad taste in my mouth.
So continue using Perl 5. It's not going anywhere.

Also, what don't you like about Perl 6? It is hard to find people who aren't already die-hard Perl 5 guys who don't find Perl 6 way better. (Albeit slower. Dammit.)

Try something like ML. You'll learn new concepts.

Name: Anonymous 2011-12-04 3:18

>>27

how similar is ML to haskell?

Name: Anonymous 2011-12-04 3:55

>>28
ML is like C, while Haskell is like C++.

Name: Anonymous 2011-12-04 4:03

>>28
Well it's less Haskell-y. There are mutable things.

Haskell is not like C++. (And ML is not like C.)

Name: Anonymous 2011-12-04 4:03

>but Perl 6 is not so good and has left a bad taste in my mouth.
Have you installed pineapple module from CPAN? It improves the taste.

Name: Anonymous 2011-12-04 4:07

>>25
I agree "like C" is too vague. I'm not an experienced programmer and I'm really picky about what language I program in for some reason. I start "real programming" with C and I just really liked it for various reasons. I felt like it taught me actual programming.

Anyway, after a while I would try new languages and be put off by what I thought were annoying syntax decisions or whatever. It's really stupid of me to do it, but I'm at a point in my life where I can't enjoy anything, and I'd like to be able to hold on to this.

I'm just looking for a non-OO higher level language that has syntax similar to C's. Is that still too vague? I think Perl is a decent example, and I might end up sticking with it. But if you can think of a better example, let me know.

Name: Anonymous 2011-12-04 4:10

>>30
typeclasses = template generics

Name: Anonymous 2011-12-04 4:34

>>32

I agree "like C" is too vague. I'm not an experienced programmer and I'm really picky about what language I program in for some reason.

Just learn a whole bunch of languages. After you have seen enough of them, you'll have more perspective on them, and what each one can be better suited for different situations. You are probably just experiencing a defensive reaction to the difficulty of learning a new language. This is very likely to occur if you are proficient in one specific paradigm and you are trying to learn a new, very different one. You suddenly feel incapable of doing simple things like reading input and and it is very tempting to take the easy route and stay with only what you are already familiar with.

Anyway, after a while I would try new languages and be put off by what I thought were annoying syntax decisions or whatever. It's really stupid of me to do it, but I'm at a point in my life where I can't enjoy anything, and I'd like to be able to hold on to this.


That's too bad. Maybe there are other things to experience? There's more to life than programming. It is fun, but I don't think I would program if I had a week left to live. I'd probably walk around, and climb stuff or something.

I'm just looking for a non-OO higher level language that has syntax similar to C's. Is that still too vague? I think Perl is a decent example, and I might end up sticking with it. But if you can think of a better example, let me know.

Perl is well suited for certain applications, like automated sys admining and parsing text. If you have a certain task in mind, then you should look check out what your needs will be. How fast does it need to be? What are the memory constraints? What other sorts of things will it have to interface with? What will it run on? A phone? An internet browser? A super computer? A distributed network? A TI 83? And then there is the question, what languages do other people that might work on this know, and this seems to take precedence over all other questions.

Name: Anonymous 2011-12-04 4:46

>>34
Just learn a whole bunch of languages
Isn't it way better to get good at a few languages rather than learning dozens I don't really know well at all.

Maybe there are other things to experience?
Nope. And if there are, I can't do them.

If you have a certain task in mind, then you should look check out what your needs will be.
Just something I can enjoy. Although I would like something with a nice plotting library if possible.

Name: Anonymous 2011-12-04 4:46

>>31
Perl 6 doesn't have a CPAN.

>>33
No, they're not. They serve a similar purpose, but you might as well compare recursion to for loops.

Name: Anonymous 2011-12-04 5:02

>>35

learn dozens, very well. you'll see the equivalences between them, and it'll help you in programming in all of them.

Nope. And if there are, I can't do them.

I'm getting the feeling that you are just venting and looking for pity.

Just something I can enjoy. Although I would like something with a nice plotting library if possible.

If you are interested in visualizing data, there are lots of impressive and free tools out there. Here is one:

http://www.paraview.org/

If you just want to do some graphics, you can check out SDL and OpenGL.

Name: Anonymous 2011-12-04 5:10

learn dozens, very well.
OK cool, just give me 10 years.

I'm getting the feeling that you are just venting and looking for pity.
You're the one that brought up this whole "new things to experience" bullshit.

http://www.paraview.org/
Looks a lot more in depth that I need, but I'll check it out.

Name: Anonymous 2011-12-04 5:29

>>32
I'm just looking for a non-OO higher level language that has syntax similar to C's. Is that still too vague
This C syntax requirement will limit you a lot... The classic high level languages that expands the mind in meaningful ways all have distinct syntax.

Name: Anonymous 2011-12-04 5:34

>>38

once you know a few, it becomes very easy to learn new ones. I suppose it could be better to just focus getting a solid understanding of a few at first though, and then move on to others.

Sorry. I'm used to seeing people looking for pity on the internet, and I clumped you into that group after reading your response, but seeing how I prompted you for the response, you where not looking for pity when starting the thread.

paraview is fun. The way I've used it in the past is by writing programs that calculate data and generate text files that contain data points, and then loading the text file from paraview.

Name: Anonymous 2011-12-04 6:03

IronPython maybe?
Just becouse python has OOP capabilities you don't need to use it.
With the module system you can use it as an excellent procedural language. And python is the language that hates modern syntax the most so it will probably fit you.

Name: Anonymous 2011-12-04 6:07

>>41
Python is a horrible language.

>>1
Learn Common Lisp. It's not very much like C but you won't regret it I guarantee.

Name: Anonymous 2011-12-04 6:25

>>42
Python is crap, Lisp is shit, but Common Lisp is truly diarrhoea.

Name: VIPPER 2011-12-04 6:31

>>34
There's more to life than programming. It is fun, but I don't think I would program if I had a week left to live. I'd probably walk around, and climb stuff or something.
You must be joking friend.

Name: Anonymous 2011-12-04 6:32

>>44
Go fuck an autistic nigger, faggot.

Name: Anonymous 2011-12-04 6:39

>>43
Haskell, OCaml and their ilk are part of a 45-year-old static-typing movement within academia to try to force people to model everything. Programmers hate that. These languages will never, ever enjoy any substantial commercial success, for the exact same reason the Semantic Web is a failure. You can't force people to provide metadata for everything they do. They'll hate you.

An important theoretical idea behind type systems is "soundness". Researchers love to go on about whether a type system is "sound" or not, and "unsound" type systems are considered bad. C++ and Java have "unsound" type systems. To date, the more "sound" a type system is, the more often it's wrong when you try to use it. This is half the reason that C++ and Java are so successful: they let you stop using the type system whenever it gets in your way. The other half of their success stems from the ability to create user-defined static types. The reason C++ and Java (particularly Java) have been so successful is that their type systems form a "let's not get any work done" playground for n00bs to spend time modeling things and telling themselves stories. You can't actually model everything; it's formally impossible and pragmatically a dead-end. But they try. And they tell their peers that you have to model everything or you're a Bad Citizen.

One very real technical problem with the forced-modeling approaches that static type systems are often "wrong". It may be hard to imagine, because by a certain definition they can't be "wrong": the code (or data) is programmatically checked to conform to whatever constraints are imposed by the type system. So the code or data always matches the type model. But the type system is "wrong" whenever it cannot match the intended computational model. Every time want to use multiple inheritance or mixins in Java's type system, Java is "wrong", because it can't do what you want. You have to take the most natural design and corrupt it to fit Java's view of the world.

Name: Anonymous 2011-12-04 6:49

Have you considered Pike?

It's basically just C with garbage collection, anonymous functions, and classes.

http://pike.ida.liu.se/

Name: Anonymous 2011-12-04 7:05

>>46
Sounds like a load of bull, not sure if troll. I haven't met a type system I couldn't subvert, and I only rarely provide type information to the MLs. I don't feel compelled or obligated to "model everything" either.

Personally I benefit from static typing. I don't demand soundness but I'm not a pussy about it either. I certainly don't cry about it when the compiler tells me my program is incorrect.

Name: Anonymous 2011-12-04 7:08

>>48
"correctness" is a buzzword.

Name: Anonymous 2011-12-04 7:13

>>49
"buzzword" is not jewish.

Name: Anonymous 2011-12-04 7:33

>>50
"jewish" is not correct.

Name: Anonymous 2011-12-04 7:48

OP, try Symta.

SYMTA> ($eval "ls {$@Data units} | map 'rhd")
_construction_site _corpse _destroyed_site alleria altar_of_storms armor2 armor3 arrow attack attack2 attack3 axe ballista ballista_bolt battleship berserker blizzard bloodlust boar board build build_advanced build_basic building cancel cannon cannon2 cannon3 cannon_big cannon_impact cannon_land castle catapult catapult_rock `cho'gall` church circle_of_power cross_green cross_red daemon daemon_attack danath dark_portal death_and_decay death_coil death_knight deathwing demolish dentarg die dragon dragon_breath dragon_roost dwarven_demolition_squad elven_archer elven_destroyer elven_lumber_mill exorcism explosion explosion_small eye_of_kilrogg eye_of_kilrogg_spell farm fire fire_big fire_small fireball fist flame_shield footman fortress giant_turtle gnomish_flying_machine gnomish_inventor gnomish_submarine goblin_alchemist goblin_sappers goblin_zeppelin gold_mine great_hall grom_hellscream grunt gryphon_aviary gryphon_hammer gryphon_rider `gul'dan` harvest haste haul_oil healing hellhog human_barracks human_blacksmith human_cannon_tower human_foundry human_guard_tower human_oil_platform human_refinery human_shipyard human_tanker human_transport human_watch_tower invisibility keep khadgar knight korgath_bladefist `kurdan_and_sky'ree` lightning lightning_impact lothar mage mage_tower missile morph move move_ship nil ogre ogre_juggernaught ogre_mage ogre_mound oil_patch orc_barracks orc_blacksmith orc_cannon_tower orc_foundry orc_guard_tower orc_oil_platform orc_refinery orc_shipyard orc_tanker orc_transport orc_watch_tower paladin peasant peasant_attack peasant_rebel peon peon_rebel pig_farm player polymorph producing raise_dead ranged2 ranged3 ranger remove repair ...

Name: Anonymous 2011-12-04 9:04

OP, try C++11

Name: Anonymous 2011-12-04 9:20

>>53
Ey said ey wants a language that isn't shit.

Name: Anonymous 2011-12-04 10:00

Fucking assembly better then c++, atleast no fucking types or nullpointer exception from hell, and no fucking inhertiance full retard chains.

Name: Anonymous 2011-12-04 11:00

>>35
Although I would like something with a nice plotting library if possible.
Python has a nice plotting library. But if you're all about the plotting and the matrices, try R or Matlab (/Octave).

Also,
Isn't it way better to get good at a few languages rather than learning dozens I don't really know well at all.
It's stupid to choose to specialize in a specific area before you even have an overview of the field. Having even very brief experience with different language designs should help you in your day-to-day programming in whatever language you choose. It also prevents some common types of tunnel vision.

Name: Anonymous 2011-12-04 11:44

Name: Anonymous 2011-12-04 11:53

Name: Anonymous 2011-12-04 11:56

>Dave Herman
>Grown mature person
>Starts to talk
>Furry avatar
>I heart JavaScript
IHBT

Name: Anonymous 2011-12-04 12:23

You want Go.

Name: Anonymous 2011-12-04 13:02

>>47
GC IS SHIT

Name: Anonymous 2011-12-04 15:12

>>57
Javascript
"the language it wants to be"
he menas Lua

Name: Anonymous 2011-12-04 17:49

ITT: retards think that high-level = high-level of abstraction

Name: Anonymous 2011-12-04 18:42

Name: Anonymous 2011-12-04 19:07

>>64
To be fair wikipedia is talking about taking the machine details away while there are low-level languages that will give you powerful abstraction features. I have no idea which >>63 meant though.

Name: Anonymous 2011-12-04 19:19

check my high level dubs

Name: Anonymous 2011-12-04 20:27

>>56
Yeah, I'm already pretty good with MATLAB/Octave. Used it in college a lot. I worked with R a little bit, but again I was put off by some of the odd syntax.

I'll try out the suggestions in this thread (other than Python, I already tried it out). Also, why do you guys recommend Common Lisp? I was going to use Scheme so I could learn it with SICP.

Name: Anonymous 2011-12-04 20:28

>>63
implying high-level != high-level of abstraction

Name: Anonymous 2011-12-04 21:58

>>67
MATLAB!
Nice choice for girls.

Name: Anonymous 2011-12-04 23:09

>>69
u sure told em bro

Name: Anonymous 2011-12-04 23:12

Use C++, but not all the crazy and excessive features (which require crazy and excessive syntax).

Name: Anonymous 2011-12-05 0:03

>>71
IHBT!

Name: Anonymous 2011-12-05 0:28

>>69
Wasn't my choice, we used MATLAB in my college. Truth be told it's innate matrix math ability made a lot of our simulations really easy. That plus it had a lot of good visualization tools.

Name: Anonymous 2011-12-05 1:48

Bash (71 chars):

for f in *.png; do convert "$f" $(echo "$f" | sed 's/png$/jpg/'); done



Symta (53 chars):

fe (F:[@P [N {png}]] -> convert F [@P [N {jpg}]]) ls

Name: Anonymous 2011-12-05 2:04

C/C++/Java/C#

System.FileAccess.CDirectoryIterator System.FileAccess.openDirectory("./", "rw");
It.setFilterExpression("*.png");
while (It.notEnd()) {
  CString Src = It.getName();
  CString Dst = Src.copy();
  System.RegEx.replace(Dst, "$png", "jpg", System.RegEx.SingleOccurency);
  System.ImageLibrary.CImage Img;
  Img.loadPNG(Src);
  Img.saveJPG(Dst, System.ImageLibrary.Overwrite);
  It.advance();
}

Name: Anonymous 2011-12-05 2:23

>>74
Symta is shit.

Name: Anonymous 2011-12-05 2:47

>>71
What do you mean? “Write in C, compile with g++”?

Name: Anonymous 2011-12-05 2:54

>>77

He probably means, use classes, use one consistent version of inheritance, don't overdo it with multiple inheritance, and don't make template <template>  <template friend> Functor++ &*friend >>>>>>template< > << friends*&.

Name: Anonymous 2011-12-05 3:56

>>76
Doubt you're confident enough to judge.

Name: Anonymous 2011-12-05 4:49

>>78
This would be awesome if anyone managed to read.

Name: Anonymous 2011-12-05 4:54

rpython
please use tabs instead of spaces

Name: Anonymous 2011-12-06 3:09

>>75
Doesn't look like C at all to me

Name: Anonymous 2011-12-06 11:39

FUCK!

Seriously... I've got a message for 90% of you posting this thread.

It's very simple: GC is shit.

[i]shit[/shit]

Stop trolling now. OP asked for advice and you offer your GC toy languages? Go fuck yourselves. I hope you face horrible deaths.

consider this:
- Java == GC --> shit
- Lisp == GC --> shit
- D == GC --> shit
- Haskell == GC --> shit
- 99% of the suggestions in this thread == GC --> shit

And OP, you just stick with C. If you want higher level features, you should use C++. It doesn't force GC. It's not shit.

GC is shit. I'm not joking.

Name: Anonymous 2011-12-06 11:50

>>83
GC might be shit but Lisp isn't. Also, C++ is an abomination.

Name: Anonymous 2011-12-06 11:59

>>83
C++ might be shit but GC isn't. Also, Lisp is an abomination. Also, fuck off and die you piece of shit.

Name: Anonymous 2011-12-06 12:13

>>84-85
Yeah, you just keep trolling. That's what you know best.

Name: Anonymous 2011-12-06 12:18

>>86
Fuck you lithpfag.

Name: Anonymous 2011-12-06 12:28

>>86
Check out that Intel GET!

Name: Anonymous 2011-12-06 13:57

Let's see, for non-ASM/C/C++ non-GC languages, we have:
pre-Algol-68 (no heap)
BASICs when ignoring the string table, Integer and embedded system BASICs
COBOL (ALLOCATE / FREE)
Forth (ALLOCATE / FREE)
Fortran (ALLOCATE / DEALLOCATE),
Modula-2 (NEW / DISPOSE) but not Modula-2+, Modula-3, Oberon
Objective-C with GC disabled (alloc / new / copy / release)
PL/I (ALLOC / FREE)
Pascal (NEW / DISPOSE / setLength / .create / .destroy)
PostScript Level 1 (no heap?) but not Level 2
RPG (ALLOC / %ALLOC / DEALLOC)

GC but some optional manual memory management?
AutoHotkey (VarSetCapacity)
D had delete but deprecated
Factor ((malloc) / (free), previously malloc)
Object REXX only (RexxAllocateMemory / RexxFreeMemory)
PureBasic (AllocateMemory / FreeMemory)
R (rm)
Retro (allot)
ZX Spectrum BASIC (CLEAR)

Garbage collected:
Everything else worth a shit.

Name: Anonymous 2011-12-06 14:47

>>21
which could be accomplished easily with a script that compiles c with namespaces to c with name mangling.
Name mangling is utter bullshit for anything meant to be interfaced with.

Name: Anonymous 2011-12-06 15:27


dead? U -> U,n? || (and U.Mask TileMasks.Dead)!=0
targetable? U -> U && U.Parent,n?
selectable? U -> U,dead?,n? && U,targetable? && U.HP,pos?
center U -> U.Tile + U.Size%%2
centerDisp U -> U.Disp +16U.Size-[16 16]
distanceToPlayer XY -> abs XY - Units,ThisPlayer,center
prettyName U -> U.UIName || sym (subst "_" " " U.Type,str)
unitUiColor U -> U.Owner==ThisPlayer |> #00FF00 :: Tints.(U.Color)
hp100 U -> H:U.HP (H-U.Hits)*100%%H
actGT N O -> NP:N.Prio OP:O.Prio -> OP<NP || OP==NP && O.Forced,n?
order O U -> O,sym? |> O=:UTs.'O -> Id:(U,xs? |> U.Id :: U)
          -> actGT O Orders.'Id |> Orders.'Id=:O -> U
unitSay S U -> U,int? |> U=:Units,U -> D:n
 -> S:U.Sounds.(S,([N I] -> D=:I -> N; S->S))
 -> snd\play (D|>S,D::S,pick) Volume=1.0-U.Tile,distanceToPlayer/24
act O U -> O,sym? |> O=:UTs.'O -> !O.Dst || U.Id -> !O.Range || U.Range || 1
        -> U.Path |> U.Path=:n -> U.Act=:O
units Is -> map ?,(I:int?->Units,I; U->U) Is

anim A U -> U.Anim =: (U.Anims.'A||U.Anims.Still)
swapAnim D S U -> UTs.(U.Type).Anims.'S |> U.Anims.'D=:It :: U


morph T U -> O:U.Owner T:(T,sym? |> UTs.'T :: T) -> T.Id=:U.Id
 -> T.Owner=:O     -> T.Color=:U.Color -> T.Act=:U.Act     -> T.Tile=:U.Tile
 -> T.Disp=:U.Disp -> T.Dir=:U.Dir     -> T.Frame=:U.Frame -> T.Anim=:U.Anim
 -> T.Hits=:U.Hits -> T.Kids=:U.Kids   -> U.Effects |> T.Effects=:It
 -> U.Fire |> T.Fire=:It -> U.Res |> T.Res=:It -> U.Mana |> T.Mana=:It
 -> skip1 U.Id !Owned,O.(U.Type) => @!Owned,O.(T.Type) T.Id -> T


awayFrom 'f R SR -> RT:~[R R] RS:[2R 2R] take MaxUnits Units
  | all (n?->y; U->rectsIsect [@(U.Tile+RT) @(U.Size+RS)] SR && f U | n?)

efx U Es -> merge !U.Effects Es

flipUnitLayer U -> updArea U (C->xor !C.Mask U.Layer)

mark U -> Id:U.Id S:U.Sight
 -> updArea U (C => @!C.Content Id -> xor !C.Mask U.Layer)
 -> updArea [Tile=U.Tile-[S S] Size=U.Size+[2S 2S]] (C => @!C.Sensors Id)

unmark U -> Id:U.Id S:U.Sight
 -> updArea U (C -> skip1 Id !C.Content -> xor !C.Mask U.Layer)
 -> updArea [Tile=U.Tile-[S S] Size=U.Size+[2S 2S]] (C -> skip1 Id !C.Sensors)

deployUnit XY U => @!U Tile=XY Disp=32XY -> aset U.Id U Units -> mark U

newUnit O T Delay=n -> T,sym? |> T=:UTs.'T -> R:(Delay||rand 6)+1+Cycle
 -> U:[@T Id=FreeIds,pop Owner=O Color=(T.Color||Units,O.Color||{Yellow})]
 -> U.MP |> [@!MUs updMana U.Id]
 -> U.Upgrades |> map (upgrade ? !U) (keep Owned,O.? It)
 => @!Scheds.'R U.Id => @!Owned,O.(T.Type) U.Id -> U

delUnit Id -> U:Units,Id O:U.Owner -> U.Disp |> unmark U -> ~@!Orders.'Id
 -> skip1 Id !Owned,O.(U.Type) => @!FreeIds Id -> aset Id n Units

freeUnit U => @!DelUnits (U,int? |> U :: U.Id) -> U

killUnit U
 -> (and U.Mask TileMasks.Dead)==0 |>
    (-> U.Disp |>
        (-> U.Layer == TileMasks.`2` |>
            (-> U,unmark -> U.Layer=:TileMasks.`0` -> U,mark)
         -> U.Explodes |> spawnFx U.Tile It D=U,centerDisp-[16 16]
         -> U.Building |>
            (-> U.Fire=:n
             -> E:UTs.(U.Extends) R:E.Resource E && (R,n?||U.'R,pos?) |>
                (-> N:(newUnit 0 E.Type) -> deployUnit U.Tile N.'R=:U.'R)))
     -> U.Parent |> [@!Trans 'unkid [It U.Id]]
     -> U.Incomplete,n? && U.Supply |> [[U.Id {Food} ~It]@!NQs.(U.Owner).`+`]
     -> U.Cost.Food |> [[U.Id {Food}  It]@!NQs.(U.Owner).`+`]
     -> or !U.Mask TileMasks.Dead)
 -> U

spawnUnit O T XY A=n TTL=n -> U:[@(newUnit O T) Tile=XY] -> A |> (anim A !U)
 -> U.Building||U.Dir=:Dirs,pick => @!Trans 'show U.Id => U@!NewUnits -> u

DeathAnim ~> (0 0)
StillAnim ~> (0 6)
BuildingAnim => Still={(0 6)} `50`={(1 6)} `25`={(2 6)} `0`={(3 6)}
                Attack={attack (0 60)} Death={(4 200) (5 200)}

chkCost Rs C -> D:(~@C.Time | map ([R A] => R Rs.'R-A))
             -> keep ([_ neg?]->y) D |> D

chkCosts U T
 -> (T.UCost |> chkCost U It) || (T.OCost |> chkCost Units,(U.Owner) It)

canAct U A T
 -> A.Rule |> fc It U A T :: y |>
    (chkCosts U A |> do (notify "Not enough $(It,0,0) for $(A.Type)") n :: y)

enemyOf U X -> fnd X.Owner Units,(U.Owner).Enemies
canAttack U A T -> T && (A.Confirm||enemyOf U T) && (and A.Mask T.Mask)==T.Mask

CoastMask -> TileMasks.Coast
ruleCoast P -> points [@P 3 3] | any (P->(and P,cell.Mask CoastMask)!=0)
ruleGoldMine P -> awayFrom ?.Depot=={Gold} 3 [@P 3 3]
ruleGoldDepot P -> awayFrom ?.Resource=={Gold} 3 [@P 4 4]
ruleOilDepot P -> P,ruleCoast && awayFrom ?.Resource=={Oil} 3 [@P 3 3]

canHarvest U A -> R:U.Resource
 -> R && U.Foundation,n? && (fnd R A.Harvests |> U.'It,pos? && It)
ruleHarvest U A T -> canHarvest T A |> U.'It<100

doHarvest U -> A:U.Act Dst:A.Dst D:Units,Dst R:A.Res
 -> R || (-> R=:(canHarvest D A) -> U.Act.Res=:R)
 -> cnd {U.Parent || D.TileId ->
        ;y => @!Trans 'hide [Dst U.Id] -> U.Act.Sounds=:n -> anim {Still} !U}
 -> U

fixHarvest U -> A:U.Act Id:A.Dst D:Units,Id R:A.Res
 -> cnd {U.'R>=100 -> swapAnim {Move} R !U | swapAnim {Still} "$(R)Still"
                   -> U.Parent |> (=> @!Trans 'show U.Id -> anim {Still} !U)
                   -> act [@UTs.Store Back=Id Res=R Depot=A.Depot] !U
        ;D.TileId && findResource U D.Tile A -> U.Act.Dst=:It
        ;y -> U.Act=:n}
 -> U

resources U -> keep U.?,pos? ResNames

doStore U -> A:U.Act R:(A.Res || U,resources,([R@_] -> U.Act.Res=:R -> R))
    Depot:A.Depot T:(Depot |> Units,Depot) | dead?
    |>(Depot || findDepot R U
       |> U.Act.Depot=:It :: (-> notify "Nowhere to store $R" -> U.Act=:n))
    ::A.State,({Near} -> swapAnim {Move} {Move} !U | swapAnim {Still} {Still}
                      => @!Trans 'hide [Depot U.Id] -> U.Act.State=:{Inside}
              ;{Inside} -> pos? U.'R
                   |> (=> @!NQs.(U.Owner).`+` [U.Id R 5] -> !U.'R-5)
                   :: (=> @!Trans 'show U.Id
                       -> O:(map UTs.? U.Acts | fnd (X -> fnd R X.Harvests))
                       -> order [@O Dst=A.Back Depot=A.Depot] U)
              ; _ -> U.Act.State=:{Near} -> U.Act.Dst=:Depot)
 -> U


ruleMove U A T -> canMoveTo T.Tile U
ruleBoard U A T -> T.Transport && T.Owner==U.Owner
doBoard U => @!Trans 'hide [U.Act.Dst U.Id] -> U.Act=:n
doUnloadSelf U => @!Trans 'show U.Id -> U.Act=:n

produce C U HP=n
 -> O:[@UTs.Producing O=Cycle T=(max 1 24C.Time%%32) Last=Cycle Cost=C]
 -> HP |> (-> U.Hits=:U.HP-1 -> O.AddHP=:U.HP/O.T) -> U.Incomplete=:y -> act O U

ruleBuild U A T -> buildRect T.Tile U UTs.(A.What) | all 'y?

doBuild U -> A:U.Act
 -> B:(newUnit U.Owner A.What) -> B.Tile=:Units,(A.Dst).Tile
 -> E:(map Units,? B.Tile,cell.Content | fnd ?.Type==B.Extends)
    |> (-> R:E.Resource B.'R=:E.'R -> freeUnit E)
 -> swapAnim {Still} "0" !B -> produce A.OCost !B HP=y
 -> B.Anims.Still | ([[F _]@_] -> B.Frame=:F) -> unitSay {Construction} B
 => @!Trans 'hide [B.Id U.Id] 'show B.Id => @!NewUnits B -> U.Act=:n

doTrain U -> A:U.Act P:A.Producing
  |> (-> fnd P U.Kids |> U :: U.Act=:n)
  :: (-> NU:[@(newUnit U.Owner A.What) Tile=U,center Parent=U.Id]
      -> produce A.OCost !NU -> A.Research |> NU.Research=:y
      -> NU.Dir=:Dirs,pick => @!NewUnits NU
      => @!U.Kids NU.Id => @!U.Act Producing=NU.Id OCost=n)

doMorph U -> A:U.Act T:UTs.(A.Into) -> U.MorphTo=:T.Type -> U.Gfxes=:T.Gfxes
          -> produce T.Cost !U -> U.Anims=:T.Anims -> anim "50" !U -> U

doProducing U
 -> A:U.Act fin:(-> swapAnim {Still} {Still} !U | anim {Still}
                 -> max !U.Hits 0 | int -> ~@U.Incomplete -> U.Act=:n)
    cnd {(C:Cycle-A.O) < (T:A.T)
         -> anim cnd,{C/T<1/4->"0"; C/T<1/2->"25"; y->"50"} !U
         -> !U.Hits - (Cycle-A.Last)*A.AddHP => @!U.Act Last=Cycle
        ;U.Research -> T:U.Type O:U.Owner
          -> U.MorphAll |> morphUnits O It T
          -> U.Upgrade |> map (upgradeUnits O ? T) Upgrades.'T
          -> rekid U.Owner U.Id -> fin
        ;U.Parent -> unitSay {Ready} U => @!Trans 'show U.Id -> fin
        ;N:UTs.(U.MorphTo) -> morph N !U -> fin
        ;y -> U.Supply |> [[U.Id {Food} It]@!NQs.(U.Owner).`+`]
           -> U.Kids,([Id@_] -> unitSay {Work_Done} Id -> showKids U) -> fin}

doCancel U
 -> (A:U.Act.What).Type == {Producing}
    |> (-> for [R A]=~@A.Cost.Food [[U.Id R A]@!NQs.(U.Owner).`+`]
        -> U.MorphTo |> (-> U.Gfxes=:UTs.(U.Type).Gfxes -> U.Act=:n)
                     :: (-> showKids U | order {Die}))
    :: U.Act=:n
 -> U

animSpeed [[_ W _]@Xs] -> W+Xs,animSpeed
DummyFrame => 8++DummyGfx
AttackLayers -> map TileMasks.? 0..9 | fold 'or
MCs => Coast={Water Coast} Water={Water} Land={Plain Mud}
       Air={Rock Forest Plain Mud Coast Water Wall}
       Plain={Plain} Wall={Wall} Invuln={Invuln}

Name: Anonymous 2011-12-06 15:42

>>90
Not if mangling is sane.
Just put Average_insertValue instead of insertValue__7AverageFv and I won't care about. Don't people write glRotatef instead of gl::rotate(float) anyways?

Name: Anonymous 2011-12-06 17:30

GC is great, Lisp/C++ is for faggots.

Name: Anonymous 2011-12-06 18:37

>>83
You call all those languages shit, then have the gal to tell the OP to use C++?

What's your problem?

Name: Anonymous 2011-12-06 19:25

>>94
yhbt

Name: >>99 2011-12-06 20:44

>>98
Thanks!

Name: Anonymous 2011-12-06 21:41

check 'em

Name: Anonymous 2011-12-06 23:43

>>97
check what?

Name: Anonymous 2011-12-07 0:07

>>99
dubs!

Name: Anonymous 2011-12-07 5:15

dubs again

holy shit we are on fire

Name: Anonymous 2011-12-07 7:09

Binary JACKSON 5 GET.

Name: Anonymous 2011-12-07 8:56

>>101
not bad

Name: Anonymous 2011-12-07 12:39

base 14 dubz
<---- check em'

Name: Anonymous 2011-12-07 14:12

wanting high level language...

not using vb or delphi

What is this board? L33t kids who just wrote "hello world" in school and think of themselves as cool programmers?

Name: Anonymous 2011-12-07 14:12

4wy4wy

Name: Anonymous 2011-12-07 14:12

4wy4wy4wtt4

Name: Anonymous 2011-12-07 14:33

>>104

Why would anyone want to use vb?

Name: Anonymous 2011-12-07 15:04

>>107
YHBT

Name: Anonymous 2011-12-07 15:17

>>108
The first thing I coded was a silly chess game inside a Word 97 document with VBA macros and forms. It's sad that I needed to read books to learn C and C++ though.

Name: Anonymous 2011-12-07 23:07

wanting to use /g/ speak on /prog/

not going back to /g/

What is this board? L33t kids who accidentally clicked a link to /prog/ someone posted on /g/ in school and think of themselves as cool programmers?

Name: Anonymous 2011-12-07 23:54

>>91

What language is this? Haskell? It makes me want to prolog.

Name: Anonymous 2011-12-08 3:27

>>111
sweet trips bro

Name: Anonymous 2011-12-08 3:42

>>112
thanks bro

Name: Anonymous 2011-12-08 3:57

SQL

Name: Anonymous 2011-12-08 5:36

>>111
I'm going to guess Erlang

Don't change these.
Name: Email:
Entire Thread Thread List