Recent Posts

Pages: [1] 2 3 ... 10
1
Tutorials and articles / Re: Notes on Script BASIC
« Last post by B+ on Today at 18:21:20 »
Thanks, Tomaaz, I did start your Dir Walk challenge in another thread with a couple of questions (I hope remarks to folks at ALL aren't too distracting.)

Why yes I was at BP.org, "moderating" uh himmm ... towards the end, you don't remember?
2
General questions and discussions / Re: Beginner friendly BASICs
« Last post by Tomaaz on Today at 18:18:07 »
B+, do you believe me now?  ;D
3
General questions and discussions / Re: Beginner friendly BASICs
« Last post by Aurel on Today at 18:13:40 »
Just a idea for new PLcr**

class SNAKE
    {
method Pussy
   {
       self.suckMap["Li" ,"c","k"]
    }
method Smoke
}

etc...etc .... yo! too funny i will blow  ;D
4
General questions and discussions / Dir Walk Challenge
« Last post by B+ on Today at 18:03:05 »
Quote
Tomaaz
Full Member
***
 
Posts: 123
View Profile  Personal Message (Online)

Re: Notes on Script BASIC
Reply #35 on: 22. September 2018, 17:48:49
Quote
OK. Here is another task. Recursively walk directory, find all .jpg files which names are integers, sort the names by numbers and print the result.

Ruby (one line):
Code: [Select]
puts Dir.glob("**/*").select{|a| File.extname(a) == ".jpg" and File.basename(a, ".jpg").to_i.to_s == File.basename(a, ".jpg")}.map {|a| File.basename(a, ".jpg").to_i}.sort

If you want to know what part of the code is responsible for what part of the task, I can explain it to you. It only looks cryptic. If you know basics of Ruby it's clear as
Code: [Select]
for x = 1 to 10 : print x : next x
in BASIC.  ;)

Tomaaz do you have sample screen shot of output. I am probably going to repeat a question about "map" but it might be solved by picture.

Also I assume it doesn't have to be .jpg extension or start with number maybe any base name condition is good.
I'd prefer to build something that actually might have some use for me and this sort of stuff is not but a .bas file starting with certain base names might be very useful. I mean I hate to be accused of playing around ALL of the time with my BASIC's.


@ Mike
The B of B+ mostly stands for Build as in B += .... But standing for Eternal Beginner is OK too, someone should keep the eternal flame alive.
5
Tutorials and articles / Re: Notes on Script BASIC
« Last post by Tomaaz on Today at 18:02:37 »
Yeah sure blame it on him. (Though it's definitely more than partly true, you love it.) I had a serious question, is it being ignored?

Sorry, but no - I don't like it. I prefer the kind of discussions you can have with zxDunny, Peter (BaCon) or Marcus (NaaLaa), for example. Remind me - were you a member of old basicprogramming forum? While it's fun to read Aurel's surreal English for some time, it becomes annoying very quickly and destroys every single topic, especially that 80% of his arguments are personal attacks, copy/paste insults and a demonstration of a total lack of knowledge of anything beyond BASIC and WinApi ("https is just another crap" etc.). But the worst are his lame attempts to be funny and make linguistic jokes.

Sorry, I missed you questions. Here are the answers:

How hard is it to change your output to this? (attached)

Python:
Code: [Select]
x = [120, 135, 345, 345, 1890, 12, 120, 12, 135, 712, 78, 120]
print(map(lambda a: "Tomaaz " + str(a), sorted(list(set(x)), reverse=True)[0:3]))

NewLisp:
Code: [Select]
(set 'x '(120 135 345 345 1890 12 120 12 135 712 78 120))
(println (map (fn (x) (append "Tomaaz " (string x))) (slice (sort(unique x) >) 0 3)))

And how do these things handle floats? The forth line? I am curious the decision it would make for 1, 1.0, 1. and .99.... would they be the same or each unique?

In Python and NewLisp 1 and 1.0 are treated as the same number. In Ruby they aren't. 0.99..... in all three languages is unique element, however, while Ruby and Python keep the value, NewLisp is changing it slightly to something like 0.99999989999 (different number representation).
6
General questions and discussions / Re: Beginner friendly BASICs
« Last post by B+ on Today at 17:38:11 »
Hi D,

Best graphics entrance of singer I've ever seen, was that you?

I would guess you worked on the sound were you also filmed? or had any part in graphics effect?
7
Tutorials and articles / Re: Notes on Script BASIC
« Last post by B+ on Today at 16:47:55 »
Yes, that would be great, but I seriously doub " the WinApi guru" will let us do it. He's already declared Python, Perl, Ruby etc. to be "junk",  OOP to be " useles" and https to be "just another crap". When he sees my nickname together with the word " Python" in one post,  it's the end of serious discussion (this topic is a perfect example).

Yeah sure blame it on him. (Though it's definitely more than partly true, you love it.) I had a serious question, is it being ignored?

PS I am eager to try an SB out on this latest challenge, will someone please post something in another thread or do I have to do it again?
8
Offtopic / Re: John's reason for leaving
« Last post by B+ on Today at 16:41:03 »
BTW has anyone noticed that he has doctored his quote of me, cutting off "for servers" and moving the period to the end of "his tool".

What a crazy guy!  ;D

9
Tutorials and articles / Re: Notes on Script BASIC
« Last post by Tomaaz on Today at 16:39:32 »
Yes, that would be great, but I seriously doub " the WinApi guru" will let us do it. He's already declared Python, Perl, Ruby etc. to be "junk",  OOP to be " useles" and https to be "just another crap". When he sees my nickname together with the word " Python" in one post,  it's the end of serious discussion (this topic is a perfect example).
10
Offtopic / Re: John's reason for leaving
« Last post by ZXDunny on Today at 11:37:22 »
Well, I suspect that I was somewhat partly to blame for his leaving and I don't regret it one bit. He polluted every single thread started about other BASICs with comments about how they weren't BASIC, how they weren't as good as Script BASIC, and how anyone using them was wasting their time on "toys". It was becoming tiresome.

Besides, he's flounced out of here (and ancestor sites) before.
Pages: [1] 2 3 ... 10